DOMReady in IE

17 views
Skip to first unread message

Gustaf Forsslund

unread,
Dec 9, 2009, 5:21:38 AM12/9/09
to DOMAssistant
Hi. I have recently tried to fix some bugs on a banner intensive site
running DOMAssistant. What I realised was that the DOMReady event
sometimes fired far too early i IE (at least IE7). In the end I
modified my own DOMAssistant code (version 2.7.4) by mixing the
original code with Diego Perini's ideas from jQuery (yes, I was in a
hurry - I had to get this to work quick). I have noticed that Diego's
ideas (the try-catch-doScroll-part) also seems to be integrated in the
lastest versions of YUI. So, it might be an idea to bring these into
DOMAssistant as well. Or maybe I am the only one who has experienced
these problems so far.


My code after modifications:

/*@cc_on
@if (@_win32 || @_win64)
document.attachEvent("onreadystatechange", function() {
if (document.readyState === "complete") {
document.detachEvent("onreadystatechange", arguments.callee);
DOMHasLoaded();
}
});
if (document.documentElement.doScroll && window == window.top)
(function() {
if (DOMLoaded) {
return;
}
try {
document.documentElement.doScroll("left");
} catch(error) {
setTimeout(arguments.callee, 0);
return;
}
DOMHasLoaded();
})();
@end @*/

Robert Nyman

unread,
Dec 9, 2009, 5:23:06 AM12/9/09
to domass...@googlegroups.com
Thanks for sharing!

Best regards,
Robert




--

You received this message because you are subscribed to the Google Groups "DOMAssistant" group.
To post to this group, send email to domass...@googlegroups.com.
To unsubscribe from this group, send email to domassistant...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/domassistant?hl=en.



Reply all
Reply to author
Forward
0 new messages