http://api.jquery.com/jQuery.getScript/
or
(function(){ this.__defineGetter__("__FILE__", function() { return (new Error).stack.split("\n")[2].split("@")[1].split(":").slice(0,-1).join(":"); }); })(); (function(){ this.__defineGetter__("__DIR__", function() { return __FILE__.substring(0, __FILE__.lastIndexOf('/')); }); })(); function include(file,charset) { if (document.createElement && document.getElementsByTagName) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', __DIR__ + '/' + file); if(charset){ script.setAttribute('charset', charset); } head.appendChild(script); } }
000000
source share