Skip to main content

Bug Tracker

Side navigation

Ticket #2614: ready_load_order_jquery.html


File ready_load_order_jquery.html, 0.7 KB (added by diego, November 27, 2008 04:16PM UTC)

Test firing order for the ready() function

<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript">
/*
 * events still available to IE applications
 */
if (jQuery.browser.msie) {
 document.onreadystatechange = function () {
  if (this.readyState == 'complete') {
   document.body.innerHTML += ' * ' + event.type + '<br />';
   status += ' * ' + event.type;
  }
 };
}
window.onload = function (event) {
 event = event || window.event;
 document.body.innerHTML += ' * ' + event.type + '<br />';
 status += ' * ' + event.type;
};
</script>
<script type="text/javascript">
/*
 * jQuery own .ready() event
 */
$(document).ready(function () {
 document.body.innerHTML += ' * ready<br />';
 status += ' * ready';
});
</script>

Download in other formats:

Original Format