> From: Diego A.
> 
> In IE (6 and 7) the compressed version of jQuery is adding 
> the following text to the document:
> < id=__ie_init defer=true src=//:>
> 
> I know it's related to the following code (from line 1493):
>               // Only works if you document.write() it
>               document.write("<scr" + "ipt id=__ie_init defer=true " +
>                       "src=//:><\/script>");
> 
> I found this related topic...
>
http://groups.google.com/group/jquery-en/browse_thread/thread/105ccbd917252b
b2
> ...but it doesn't actually mention a solution.
> 
> Mike Alsup suggested removing the 'defer' attribute from the 
> script tag, but it doesn't apply to my case (I'm not using defer).
> 
> Any ideas why this is happening?

Hmm... Removing the 'defer' from this script tag would cause
$(document).ready() to fire prematurely - a very bad thing.

I don't know what the solution is for you, but this defer attribute also
gave me a lot of grief recently. One of our newspaper partner sites had some
JavaScript code that was setting .innerHTML of a DOM element *while the page
was loading*. This caused that special script tag to execute immediately,
also causing $(document).ready() to fire prematurely.

Fortunately, I was able to change their code to use document.write instead
of .innerHTML, but clearly the defer attribute is not very robust. I wonder
if there is a usable alternative for IE?

-Mike

Reply via email to