Hi everyone,
I'm a bit confused about some of the expressions used in conditional
statements.
One example:
for( i = 0; i < document.all.tags( elmID ).length; i++ )
{
obj = document.all.tags( elmID )[i];
if( !obj)
{
....
}
}
is this statement testing for the existence of the tags property? What
will the values stored in obj be if tags is/isn't supported? Will the
javascript continue to execute? (in my experience, FF shows an error
message in the javascript console saying that the property doesn't
exist).
The code above is included in an ' if(ie)' block, where 'ie =
document.all'. Having said that (and assuming that the initial code
listing is indeed testing the existence for the tags property), how can
the 'for' loop ever be entered if the tags property does exist (seeing
its used in the exit condition for the for loop)
Another unrelated question:
One line of code writes:
if (groupdiv.children[i].value =="undefined")
Is this testing for the existence of the value property, or is it
testing to see if the value property is equal to 'undefined'.
Is this any different to writing:
if (groupdiv.children[i].value ==undefined)
(that is, without the speechmarks) - both statements appear in the same
body of code.
TIA for any help!
Taras