2011-02-03 02:57:44 +00:00
|
|
|
// Simple script loader that uses jQuery.readyWait via jQuery.holdReady()
|
2011-02-12 02:42:35 +00:00
|
|
|
|
|
|
|
//Hold on jQuery!
|
2015-09-02 23:52:01 +00:00
|
|
|
jQuery.holdReady( true );
|
2011-02-12 02:42:35 +00:00
|
|
|
|
|
|
|
var readyRegExp = /^(complete|loaded)$/;
|
|
|
|
|
2015-09-02 23:52:01 +00:00
|
|
|
function assetLoaded( evt ) {
|
2011-02-12 02:42:35 +00:00
|
|
|
var node = evt.currentTarget || evt.srcElement;
|
2015-09-02 23:52:01 +00:00
|
|
|
if ( evt.type === "load" || readyRegExp.test( node.readyState ) ) {
|
|
|
|
jQuery.holdReady( false );
|
2011-02-12 02:42:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setTimeout( function() {
|
2015-09-02 23:52:01 +00:00
|
|
|
var script = document.createElement( "script" );
|
2011-02-12 02:42:35 +00:00
|
|
|
script.type = "text/javascript";
|
|
|
|
if ( script.addEventListener ) {
|
|
|
|
script.addEventListener( "load", assetLoaded, false );
|
|
|
|
} else {
|
|
|
|
script.attachEvent( "onreadystatechange", assetLoaded );
|
|
|
|
}
|
|
|
|
script.src = "data/readywaitasset.js";
|
2015-09-02 23:52:01 +00:00
|
|
|
document.getElementsByTagName( "head" )[ 0 ].appendChild( script );
|
2011-02-12 02:42:35 +00:00
|
|
|
}, 2000 );
|