Revision: 47937
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at June 18, 2011 20:46 by studioevoque
Initial Code
function loadScript(sScriptSrc, oCallback) { var oHead = $('head')[0]; var oScript = document.createElement('script'); oScript.type = 'text/javascript'; oScript.src = sScriptSrc; // most browsers oScript.onload = oCallback; // IE 6 & 7 oScript.onreadystatechange = function() { if (this.readyState == 'complete') { oCallback(); } } oHead.appendChild(oScript); }
Initial URL
http://www.ejeliot.com/blog/109
Initial Description
you need jQuery already loaded for this to work
Initial Title
Load a JavaScript file dynamically
Initial Tags
jquery
Initial Language
JavaScript