<script> <BR>function getJsFile(url, callBack){ <BR>var XH = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject('Msxml2.XMLHTTP'); <BR>XH.open('get',url,true); <BR>XH.onreadystatechange = function(){ <BR>if(XH.readyState == 4 && XH.status == 200){ <BR>if(window.execScript) window.execScript(XH.responseText); <BR>else eval.call(window, XH.responseText); <BR>eval(callBack)(); <BR>} <BR>} <BR>XH.send(''); <BR>} <BR></script>
//test
<script> <BR>function cb(){ <BR>alert(1); <BR>abc(); //这个是在js9.js 中的 <BR>} <BR>getJsFile('http://www.jb51.net/images/test.js,'cb'); <BR></script>