Content Loaded event for IE causes periodic hangs for some users

216 views
Skip to first unread message

John

unread,
Jul 7, 2008, 6:43:47 PM7/7/08
to Prototype & script.aculo.us
We have recently incorporated prototype.js into our software product.
Just recently we have received a small number of complaints that the
web page never stops loading. One customer in particular has these
problems quite frequently. We have narrowed the problem down to line
4025 in prototype.js (version 1.6.0.2). This line is part of some
code that handles the COMContentLoaded event for browsers that don't
support it (i.e. IE).

/* Support for the DOMContentLoaded event is based on work by Dan
Webb,
Matthias Miller, Dean Edwards and John Resig. */
...
...
if (document.addEventListener) {
...
...
} else {
document.write("<script id=__onDOMContentLoaded defer src=//:><\/
script>"); <--- Line 4025
...
...
}

This code refers to a src value of "//:". We have "fixed" this
problem by specifying a file name that doesn't exist and this appears
to work. We attempted to modify to "javascript:void(0)" but our site
uses HTTPS and we constantly get this annoying confirmation dialog.

We have been unable to reproduce this problem at our company and the
customer has since provided us remote access to one of their machines
for testing purposes.

Can anyone comment on this? I'd like to enter a bug on the
prototypejs.org web site, but I don't have any specific repro
scenario.

thanks!

jdalton

unread,
Jul 8, 2008, 12:16:31 AM7/8/08
to Prototype & script.aculo.us
This should be resolved in the near future with Prototype 1.6.0.3.
We have changed how we detect the dom load event for IE and no longer
rely on inserting a script element.

- JDD

laurin1

unread,
Jul 8, 2008, 12:23:14 AM7/8/08
to Prototype & script.aculo.us
I am having this same problem. I saw the :// using PageSpy and was
wondering what the heck that was. How did you "fix" it?

Also, jdalton, what is the projected release date of 1.6.0.3?

jdalton

unread,
Jul 8, 2008, 12:15:45 PM7/8/08
to Prototype & script.aculo.us
The quick way to fix it is to change the src to a blank.js or
something.
Prototype next release is still up in the air. Currently all the
tickets for 1.6.0.3 have patches and things.
They are just waiting to get the blessings of the core devs.

- JDD

John

unread,
Jul 8, 2008, 12:58:24 PM7/8/08
to Prototype & script.aculo.us
Thanks jdalton for your comments. I'm certainly glad to hear this
issue will be addressed in 1.6.0.3. I'm very surprised this bug isn't
discussed all that much. In our case the problem doesn't occur very
much but when it does it is serious. Users using prototype versions
1.6.0 and 1.6.0.2 should really be aware of this problem and make the
fix.

We solve the problem just as jdalton mentions above. We set src to be
the name of a javascript file (i.e. blank.js) and we don't even bother
to define the file.

John

enots

unread,
Jul 14, 2008, 4:43:41 PM7/14/08
to Prototype & script.aculo.us
Thanx for this posting.

The same problem appears in IE when using jquery. In jquery the
document.ready function fails to run when the web page never stops
loading. For more than a month now we had no clue why IE would hang
with "1 item remaining". After reading this post I changed the src=//:
into src=blank.js in jQuery and it seems that now the problem is
solved.

Enots

Jon Hohle

unread,
Aug 5, 2008, 7:50:09 PM8/5/08
to Prototype & script.aculo.us
I just ran into this with HttpWatch as well. with src=//:, HttpWatch
fails with ERROR_INTERNET_INVALID_URL. If you change the URL to
blank.js, you'll get a 404 error.

This script injection idea seems to have originated with a post from
Matthias Miller - http://blog.outofhanwell.com/2006/06/08/the-windowonload-problem-revisited/

In that original post, the script uses src="//[]". This appears to
work for me, but I haven't found any discussion as to why. If anyone
has any ideas, I'd be interested in hearing them.

Jon
Reply all
Reply to author
Forward
0 new messages