日期:2014-05-16 浏览次数:20300 次
var script = document.createElement("script"); script.language = "javascript"; script.src = "b.js"; document.body.appendChild(script);
------解决方案--------------------
<html>
<head>
<script language="javascript" type="text/javascript">
<!--
function inc(){
var oDiv = document.getElementById('here');
var oScript= document.createElement("script");
oScript.type ="text/javascript";
oScript.src="b.js";
oDiv.appendChild( oScript);
}
-->
</script>
</head>
<body>
<div id="here"> </div>
<input type="button" value="导入" onclick="javascript:inc()" />
</body>
</html>