Moderator: moderators
(function() {
Node.prototype.insertAfter = function(newNode, refNode) {
if(refNode.nextSibling) {
return this.insertBefore(newNode, refNode.nextSibling);
} else {
return this.appendChild(newNode);
}
};
var loaded = function() {
//load.injectDependency('https://github.com/cowboy/jquery-postmessage/raw/master/jquery.ba-postmessage.js');
load.injectDependency('./script/similar_artists/similar_artists.js');
};
var load = function() {
load.injectDependency('./script/similar_artists/jquery-1.5.1.min.js');
load.tryReady(0);
};
load.injectDependency = function(script) {
var sa = document.createElement('script');
sa.type = 'text/javascript';
sa.async = 'async';
sa.src = script;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertAfter(sa, s);
};
load.tryReady = function(time_elapsed) {
// Continually polls to see if jQuery is loaded.
if(typeof(jQuery) === undefined) { // if jQuery isn't loaded yet...
if (time_elapsed <= 15000) { // and we havn't given up trying...
//setTimeout("load.tryReady(" + (time_elapsed + 200) + ")", 200); // set a timer to check again in 200 ms.
setTimeout(function() {
load.tryReady(200);
}, 200);
}
else {
alert("Timed out while loading jQuery.");
}
}
else {
loaded();
}
};
load();
})();
Return to Mods, Apps and Clients
Users browsing this forum: No registered users and 16 guests