<script language="javascript"> var script = document.createElement("script"); script.language = "javascript"; script.text = "alert('hello world!')"; document.body.appendChild(script); </script> 另一方法:http://www.cnblogs.com/webqiand/p/4200414.html