[jQuery] Document Ready Fixed

[jQuery] Document Ready Fixed

> Nope. Doesn't work either. Do people even bother to test things these
> days? Or do they just have an idea and then blog about it? Grrr.
>
> -dean
I apologize for the oversight. Yes, I did test these techniques, but I
did so incorrectly. I was basing my test case off other Document Ready
examples, which are not sufficient test cases for the problem. The
problems became quite clear after I used PHP's usleep to prevent the
entire document from being sent immediately.
I have updated the post with my findings. To summarize briefly, it
appears that Internet Explorer resolves the src immediately, but will
defer execution of the script contents. You can, for example, use
|<script defer src="*javascript:'init()'*"></script>|. Internet Explore
will resolve the src, which is a string expression evaluating to
"init()". This expression effectively becomes the contents of the script
and will be invoked after the document has been loaded. (Note that you
can use a similar technique for the src of an IFRAMEs.)
The second approach failed because Internet Explorer does not respect
the defer attribute for scripts created with createElement. I have
updated this example to use document.write/onreadystatechange.
-Matthias Miller
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/