[thelist] Another Javascript question

Eric Costello eric at schwa.com
Wed Aug 9 22:01:30 CDT 2000


Change this:

	if (x = stuff[0]) { window.open(thing[0]) }

to this:

	if (x == stuff[0]) { window.open(thing[0]) }

"=" is an assignment operator. What you are doing is assigning the value of
stuff[0] to "x", and that evaluates to true all the time, thus all the
windows are opening.

"==" is a comparison operator that tests for equality, and that is what you
want here.

Eric

Eric Costello
eric at schwa.com
http://glish.com





More information about the thelist mailing list