Re: typeof document.all

>> I didn't quite understand the comment about "treating assignment as  
>>  'detecting'" because we do no such thing.
> The jaron is odd, but you do. A "detecting" use of document.all would be
> if (document.all) { IE-only content here }
> We found (see the links in
> ) that content
> also did
>  d=document;
> and so assignment is "detecting" too, and does *not* detect the
> document.all collection.

Isn't the situation here that the variable d just references the real  
document object, so that d.all in turn references the real all  
collection, which again is going to be a reference too. So  
when later is used in a boolean context, it refers to the  
same, old doc.all object with its magic "pretend to be false in  
boolean contexts" behaviour.

> wondering if using undefined instead of false as the masquerade value
> would not be even better, since undefined is falsy but also compares
> == itself and null.

Quite possibly.

-Hallvord R.

Received on Tuesday, 13 October 2009 22:09:29 UTC