function loadJs(jsFile){
if (!jsFile) return; var oHead = document.getElementsByTagName('HEAD')[0];
alert(oHead);
var oScript = document.createElement('script');
oScript.type = "text/javascript"; oScript.src = jsFile; oHead.appendChild(oScript);
}
loadJs("http://xxx.com/inc/js/jquery-1.7.1.min.js/"); //加载jquery.//加载后 后面的代码失效!
$(function(){
alert("fdsfds");
})
$(function(){
alert("fdsfds");
})
loadJs加载是需要时间的,不管有没有加载完,按照你的写法都会继续执行alert,可以加个onload