Hi John/Michael,

FOUND THE PROBLEM.

And John, I'm sure you'll be glad to know it's not a bug in jQuery.

I compress (remove white space and pointless concatinations) and re-
pack my scripts into one file with jQuery and all the plugins I use.
This error happened when I compressed and re-packed the
'packed' (compressed) version of jQuery - ie.: compressed it twice.

In the process,
document.write("<scr" + "ipt id=__ie_init defer=true src=//:><\/
script>");

Became...
document.write("<undefined id=__ie_init defer=true src=//:><\/
script>");

I just played around with my JS compressor and I've got it working
now.

Hope this helps anyone who has the same problem.

Diego A.

On May 29, 5:49 am, "John Resig" <[EMAIL PROTECTED]> wrote:
> Do you think you could find a test case for this? We were under the
> assumption that this method was fairly rock-solid, but what you
> describe sounds like a reproducible flaw. If you can make one, please
> post it to the bug tracker.
>
> --John
>
> On 5/28/07, Michael Geary <[EMAIL PROTECTED]> wrote:
>
>
>
> > > 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/105ccbd...
> > 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