| 326 | | var handler = jQuery.event.special.ready.handler; |
| 327 | | |
| 328 | | // Mozilla, Opera and webkit nightlies currently support this event |
| 329 | | if ( document.addEventListener ) |
| 330 | | // Use the handy event callback |
| 331 | | document.addEventListener( "DOMContentLoaded", handler, false ); |
| 332 | | |
| 333 | | // If Safari or IE is used |
| 334 | | // Continually check to see if the document is ready |
| 335 | | if ((jQuery.browser.msie && window == top) || jQuery.browser.safari ) (function(){ |
| 336 | | try { |
| 337 | | // If IE is used, use the trick by Diego Perini |
| 338 | | // http://javascript.nwbox.com/IEContentLoaded/ |
| 339 | | if ( jQuery.browser.msie || document.readyState != "loaded" && document.readyState != "complete" ) |
| 340 | | document.documentElement.doScroll("left"); |
| 341 | | } catch( error ) { |
| 342 | | setTimeout( arguments.callee, 0 ); |
| 343 | | return; |
| 344 | | } |
| 345 | | |
| 346 | | // and execute any waiting functions |
| 347 | | handler(); |
| 348 | | })(); |
| 349 | | |
| 350 | | // A fallback to window.onload, that will always work |
| 351 | | jQuery.event.add( window, "load", handler ); |
| | 326 | // Make sure the ready event is setup |
| | 327 | bindReady(); |
| | 328 | return; |
| 469 | | isReady: false |
| | 453 | isReady: false, |
| | 454 | readyList: [], |
| | 455 | // Handle when the DOM is ready |
| | 456 | ready: function() { |
| | 457 | // Make sure that the DOM is not already loaded |
| | 458 | if ( !jQuery.isReady ) { |
| | 459 | // Remember that the DOM is ready |
| | 460 | jQuery.isReady = true; |
| | 461 | |
| | 462 | // If there are functions bound, to execute |
| | 463 | if ( jQuery.readyList ) { |
| | 464 | // Execute all of them |
| | 465 | jQuery.each( jQuery.readyList, function(){ |
| | 466 | this.apply( document ); |
| | 467 | }); |
| | 468 | |
| | 469 | // Reset the list of functions |
| | 470 | jQuery.readyList = null; |
| | 471 | } |
| | 472 | |
| | 473 | // Trigger any bound ready events |
| | 474 | $(document).triggerHandler("ready"); |
| | 475 | } |
| | 476 | } |
| 472 | | jQuery.each( ("blur,focus,load,ready,resize,scroll,unload,click,dblclick," + |
| | 479 | var readyBound = false; |
| | 480 | |
| | 481 | function bindReady(){ |
| | 482 | if ( readyBound ) return; |
| | 483 | readyBound = true; |
| | 484 | |
| | 485 | // Mozilla, Opera and webkit nightlies currently support this event |
| | 486 | if ( document.addEventListener ) |
| | 487 | // Use the handy event callback |
| | 488 | document.addEventListener( "DOMContentLoaded", jQuery.ready, false ); |
| | 489 | |
| | 490 | // If Safari or IE is used |
| | 491 | // Continually check to see if the document is ready |
| | 492 | if (jQuery.browser.msie || jQuery.browser.safari ) (function(){ |
| | 493 | try { |
| | 494 | // If IE is used, use the trick by Diego Perini |
| | 495 | // http://javascript.nwbox.com/IEContentLoaded/ |
| | 496 | if ( jQuery.browser.msie || document.readyState != "loaded" && document.readyState != "complete" ) |
| | 497 | document.documentElement.doScroll("left"); |
| | 498 | } catch( error ) { |
| | 499 | return setTimeout( arguments.callee, 0 ); |
| | 500 | } |
| | 501 | |
| | 502 | // and execute any waiting functions |
| | 503 | jQuery.ready(); |
| | 504 | })(); |
| | 505 | |
| | 506 | // A fallback to window.onload, that will always work |
| | 507 | jQuery.event.add( window, "load", jQuery.ready ); |
| | 508 | } |
| | 509 | |
| | 510 | jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + |