Content Loaded event for IE causes periodic hangs for some users

Skip to first unread message


Jul 7, 2008, 6:43:47 PM7/7/08
to Prototype &
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 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
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 web site, but I don't have any specific repro



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



Jul 8, 2008, 12:23:14 AM7/8/08
to Prototype &
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


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



Jul 8, 2008, 12:58:24 PM7/8/08
to Prototype &
Thanks jdalton for your comments. I'm certainly glad to hear this
issue will be addressed in 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 should really be aware of this problem and make the

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.



Jul 14, 2008, 4:43:41 PM7/14/08
to Prototype &
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


Jon Hohle

Aug 5, 2008, 7:50:09 PM8/5/08
to Prototype &
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 -

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.

Reply all
Reply to author
0 new messages