为什么打破这个javascript片段?

时间:2010-08-09 13:06:05

标签: javascript

  

可能重复:
  Why split the <script> tag when writing it with document.write()?

我没有真正做Javascript编程并且很难谷歌这个但是在几个不同的地方(由优秀的开发人员)看过这样的东西:

document.writeln('<scr'+'ipt src="'+pcheck+'" type="text/javascript"></scr'+'ipt>');

总是在r和i之间进行分割。这实现了什么?

1 个答案:

答案 0 :(得分:0)

这是为了防止任何脚本阻止程序加载此脚本,因为它们无法在文本中找到“脚本”字。