#249 ✓invalid

__onDOMContentLoaded => 'null' is null error

Reported by grein46087 | July 28th, 2008 @ 06:42 PM


Line #4027

Browser version: IE 6, IE 7, IE 8

*problem: returns error 'null' is null *

The line of code

document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");

Is incorrect: as the the src attribute is being evaluated as comments. I am not sure what is desired to happen here from prototype, but it should not be using document.write(); , however nonetheless adding a new element to the DOM instead via

element = document.createElement("script");

The quick fix Solution implemented for our site:

    document.write("&lt;script id=__onDOMContentLoaded defer src='javascript:void(0)'&gt;&lt;\/script&gt;");
    if ($("__onDOMContentLoaded") != null) {
    $("__onDOMContentLoaded").onreadystatechange = function() {
      if (this.readyState == "complete") {
        this.onreadystatechange = null;

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket