为什么用document.write()编写<script>标记?为什么某些网站(或向客户提供javascript代码的广告商)使用一种将<script>和/或</script>标签在document.write()打电话?我注意到Amazon也是这样做的,例如:<script type='text/javascript'>
if (typeof window['jQuery'] == 'undefined') document.write('<scr'+'ipt type="text/javascript"
src="http://z-ecx.images-amazon.com/images/G/01/javascripts/lib/jquery/jquery-1.2.6.pack._V265113567_.js"></sc'+'ript>');</script>
4 回答
慕婉清6462132
TA贡献1804条经验 获得超2个赞
<script> var script = document.createElement('script'); script.src = '/path/to/script.js'; document.write(script.outerHTML);</script>
type="text/javascript"
郎朗坤
TA贡献1921条经验 获得超9个赞
var newScript = document.createElement("script");...
添加回答
举报
0/150
提交
取消