Thanks James, I didn't think it could be possible for document.body to be null. Your patch have made me look at JQuery's implementation and they also have a check for 'if (!document.body)' so we should roll this in. They also have specific code for supporting iframes through the 'onreadystatechange' event which seems interesting.

More info can be read here:
  http://www.subprint.com/blog/demystifying-the-dom-ready-event-method/

And of course JQuery source code, especially the bindReady and ready functions:
http://code.jquery.com/jquery-1.4.js

kind regards

bob


On 26/01/2010 01:24 AM, james_sg wrote:


if (window == top) {
   var d = window.document;
   (function () {
     try {
       d.documentElement.doScroll('left');
     } catch (e) {
       setTimeout(arguments.callee, 50);
       return;
     }
     // Dom is ready, run events
     Click.domready.run();
   })();
} else {
   var d = document;
   (function () {
     if (d.body==null) {
       setTimeout(arguments.callee, 50);
       return;
     }
     // Dom is ready, run events
     Click.domready.run();
   })();
}


Reply via email to