Klaus Hartl wrote:
> Hi all, in IE8
>
> window === window.top
>
> is false, whereas
>
> window == window.top
This may already be common knowledge, but it is new to me....
HTML5 mandates that window.top, window.parent, etc. all be WindowProxy
objects rather than true Window objects. A WindowProxy acts just like a
Window object because all of its properties are proxied directly to a
Window. A Window and a WindowProxy are not the same object, however,
and so they are not === to each other. I'm a little surprised that they
are actually == to each other in IE8, but maybe that's the way all the
browser vendors will do it.
One fix to the code would be to use == instead of ===. Another, I
suppose might be to test something like:
window.top.document === window.document
(The DOM isn't ready when this code is executed, but the document object
exists, doesn't it?)
I haven't seen an explanation of why the WindowProxy is necessary,
though I suppose that something must exist in the HTML 5 mailing lists.
I'd love to understand this, if anyone has pointers.
David
> evaluates to true. Because of this the ready event will always rely on
> document's onreadystatechange event instead of using Diego Perini's
> doScroll trick, see line 833 in event.js. I assume his trick is better
> in terms if "earliness".
>
> Can somebody please confirm this? Or is it that we want to rely on the
> event in IE8?
>
>
> --Klaus
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---