Forum Moderators: open
<script type="text/javascript">
<!---
var cookieVar = "OneTwo"
If (cookieVar == "OneTwo")
{
document.write ("Great!")
}
elseif (cookVar != "OneTwo")
{
document.write ("Not so Great")
}
//--->
</script>
But I keep getting errors, specifically the "Object Expected".
Thanks for any help offered,
I appreciate it. :)
It should work then.
Also, as your if/else if is mutually exclusive you can just write:
if (cookieVar == "OneTwo")
{
document.write ("Great!")
}
else
{
document.write ("Not so Great")
}
OK I did'nt have to rant a rave so much. But sometimes you got to let it off your chest, you know? :)
if (cookieVar == "OneTwo")
document.write ("Great!")
else
document.write ("Not so Great")
(wmw removes spaces at the start of the line, but you'd want to indent for readability)
What book would you guys recommend on JS and why?
I'm not looking for something to simple, cause that usually leaves me thinking too much. Something with too much info is just crazy. I always learn with time. A book that is somewhat in between that would be ideal, just enough info to where I know whats going on, but not so little information that I am left thinking thinking too much about it.
Thanks
This book is a reference, and not really a tutorial. I think the best way to learn js is to have some cut and paste scripts (the web is full of them - don't miss our generic javascript [webmasterworld.com] thread.) Then use an authoritative reference like O'Reilly to pull the code apart until it clicks for you.
<added>I just checked and the new 4th edition is on back order right now.</added>