Hi James,

I've checked in a possible fix for this issue. Would you be able to test this in your environment and let me know if this works for you?

Basically there is now a check in IE for the "onreadystatechange" event and the default "onload" event is handled differently.

You can grab the latest copy of control.js here:

http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/META-INF/resources/click/control.js?view=co&revision=903848&content-type=text%2Fplain

You'll also notice the following check:

  if ( !document.body ) {
    // If body is null run this function after timeout
    return setTimeout(arguments.callee, 13);
  }

But I don't think that is really necessary and it seems dangerous as it could introduce an infinite loop if the <body> element is not specified in the markup. If you remove the !document.body check, does your code still work?

Also did you specify a default <body onload"..."> event in your iframe?

kind regards

bob


On 26/01/2010 02:03 PM, Bob Schellink wrote:
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