/ Published in: JavaScript
you need jQuery already loaded for this to work
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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); }
URL: http://www.ejeliot.com/blog/109