2011-02-03 03:57:44 +01:00
|
|
|
// Simple script loader that uses jQuery.readyWait via jQuery.holdReady()
|
2011-02-12 03:42:35 +01:00
|
|
|
|
|
|
|
//Hold on jQuery!
|
2011-02-03 03:57:44 +01:00
|
|
|
jQuery.holdReady(true);
|
2011-02-12 03:42:35 +01:00
|
|
|
|
|
|
|
var readyRegExp = /^(complete|loaded)$/;
|
|
|
|
|
|
|
|
function assetLoaded( evt ){
|
|
|
|
var node = evt.currentTarget || evt.srcElement;
|
|
|
|
if ( evt.type === "load" || readyRegExp.test(node.readyState) ) {
|
2011-02-03 03:57:44 +01:00
|
|
|
jQuery.holdReady(false);
|
2011-02-12 03:42:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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 );
|