// The deferred used on DOM ready
readyList,
- // The ready event handler
- // Cleanup function for the document ready method
+ // The ready event handler and self cleanup method
DOMContentLoaded = function() {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- } else if ( document.readyState !== "loading" ) {
- // if document.addEventListener isn't present, we assume detachEvent is!
- // Make sure body exists by checking readystate, at least, in case IE gets a little overzealous (ticket #5443).
+ } else {
+ // we're here because readyState !== "loading" in oldIE
+ // which is good enough for us to call the dom ready!
document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
}
+ jQuery.ready();
},
// Save a reference to some core methods
el.type = "text/javascript";
el.onload = function() {
jQuery( document ).ready(function() {
+ jQuery("body").append("<div>modifying DOM</div>");
window.parent.iframeCallback( true );
});
}
<body>
<script type="text/javascript">
jQuery( document ).ready(function () {
+ jQuery("body").append("<div>modifying DOM</div>");
window.parent.iframeCallback( true );
});
</script>