www.htmlgoodies.com/beyond/javascript/stips/article.php/3471431
|
By Joe Burns January 4, 2005 Let's tear this one apart. Today we're going to look at a rather small but quite important command, the equal sign. Let's take a quick look at the script again:
I want you to look at two uses of the equal sign within the script:
and {parent.location="nspage.html"} Notice the first use of the equal sign doubles it up and the second is the more traditional single equal sign. Now, to us humans, one or two equal signs don't make for a big difference, but to a JavaScript-reading computer, it signifies a great deal of difference. Without getting into a lot of programming mumbo jumbo, here's the basic difference (and this always did seem backward to me).
You'll also see a single equal sign being used to denote variables and the like. Just keep it all straight by remembering that only the double equal sign means "is equal to" and the single equal sign can be roughly translated into "is." That should help you keep it all straight, too. Next Week: The IF/ELSE Condition
HTML Goodies 30-Step Primer Series and take the knowledge home with you in JavaScript Goodies! on your Web pages here! |