mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
d99268a4b7
Adds tests for the fix to #6781.
26 lines
690 B
JavaScript
26 lines
690 B
JavaScript
// Simple script loader that uses jQuery.readyWait
|
|
|
|
//Hold on jQuery!
|
|
jQuery.readyWait++;
|
|
|
|
var readyRegExp = /^(complete|loaded)$/;
|
|
|
|
function assetLoaded( evt ){
|
|
var node = evt.currentTarget || evt.srcElement;
|
|
if ( evt.type === "load" || readyRegExp.test(node.readyState) ) {
|
|
jQuery.ready(true);
|
|
}
|
|
}
|
|
|
|
setTimeout( function() {
|
|
var script = document.createElement("script");
|
|
script.type = "text/javascript";
|
|
if ( script.addEventListener ) {
|
|
script.addEventListener( "load", assetLoaded, false );
|
|
} else {
|
|
script.attachEvent( "onreadystatechange", assetLoaded );
|
|
}
|
|
script.src = "data/readywaitasset.js";
|
|
document.getElementsByTagName("head")[0].appendChild(script);
|
|
}, 2000 );
|