function loadApp(){ if (typeof oInstance=='undefined') { //console.log('loading js...'); var element=document.createElement('script'); element.setAttribute('src','https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js'); element.setAttribute('type','text/javascript'); document.getElementsByTagName('head')[0].appendChild(element); var element=document.createElement('script'); element.setAttribute('src','http://dev.imagespike.com/_nathan/excanvas.compiled.js'); element.setAttribute('type','text/javascript'); document.getElementsByTagName('head')[0].appendChild(element); var element=document.createElement('script'); element.setAttribute('src','http://dev.imagespike.com/_nathan/embed.min.js'); element.setAttribute('type','text/javascript'); document.getElementsByTagName('head')[0].appendChild(element); var oInstance = new Array(); var arrBuildInstances = new Array(); } } if (typeof arrBuildInstances=='undefined') { var oInstance = new Array(); var arrBuildInstances = new Array(); } arrBuildInstances["a02431ed-867e-11e4-bfe5-e0098a985c03"] = "a02431ed-867e-11e4-bfe5-e0098a985c03"; var thisPageUsingOtherJSLibrary = false; // Only do anything if jQuery isn't defined if (typeof jQuery == 'undefined') { if (typeof $ == 'function') { // warning, global var thisPageUsingOtherJSLibrary = true; } function getScript(url, success) { var script = document.createElement('script'); script.src = url; var head = document.getElementsByTagName('head')[0], done = false; // Attach handlers for all browsers script.onload = script.onreadystatechange = function() { if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) { done = true; // callback function provided as param success(); script.onload = script.onreadystatechange = null; head.removeChild(script); }; }; head.appendChild(script); }; getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', function() { if (typeof jQuery=='undefined') { // Super failsafe - still somehow failed... } else { // jQuery loaded! Make sure to use .noConflict just in case //fancyCode(); if (thisPageUsingOtherJSLibrary) { // Run your jQuery Code loadApp(); } else { // Use .noConflict(), then run your jQuery Code loadApp(); } } }); } else { // jQuery was already loaded // Run your jQuery Code loadApp(); };