[thelist] check existence of a javascript function

Liorean Liorean at user.bip.net
Thu Jan 24 13:54:01 CST 2002


At 11:44 2002-01-24 -0800, .jeff wrote:
>that's only a bad habit when assigning a boolean value to a variable:
>
>var isIE = (document.all) ? true : false;
>
>however, when in a conditional statement, it's assumed that expressions will
>return either true or false and therefore unnecessary to perform your own
>comparison first.  when you consider that the ternary operator is really
>just a shorthand if/else statement, i think you'll see my point.

Not at all. I don't know of any problems in ie5.5 or earlier, but I've had
problems with getting 1 and 0 to evaluate to true and false when returning
them from a function in IE6. The script worked with true and false but not
1 and 0. (Event was not canceled when 0 was delivered, even though it
worked with delivering 0 in a less complicated chain of functions.)

My guess at the reason for this behavior is that IE6 somehow turned it into
a string, but since I've not checked it's typeof value I don't really know.

// Liorean




More information about the thelist mailing list