首页 > 代码库 > 如何动态在文档中加入<script></script>写入大段js

如何动态在文档中加入<script></script>写入大段js

<script language="javascript">var script = document.createElement("script");script.language = "javascript";script.text = "alert(‘hello world!‘)";document.body.appendChild(script);</script>

 




另一方法:

http://blog.csdn.net/renfufei/article/details/18039237

如何动态在文档中加入<script></script>写入大段js