加defer属性是有用的,参考: <script type= "text/javascript ">
function hello(){
alert( "hello,world! ");
}
function testih(){
var s = "test! ";
s += " <script language= 'javascript ' type= 'text/javascript ' defer> ";
s += "hello(); ";
s += " < "+ "/script> ";
document.getElementById( "t ").innerHTML = s;
}
</script> <div id= "t "> </div>
<input type= "button " value= "test " onclick= "testih(); ">
function hello(){
alert( "hello,world! ");
}
function testih(){
var s = "test! ";
s += " <script language= 'javascript ' type= 'text/javascript ' defer> ";
s += "hello(); ";
s += " < "+ "/script> ";
document.getElementById( "t ").innerHTML = s;
}
</script> <div id= "t "> </div>
<input type= "button " value= "test " onclick= "testih(); ">
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货