What does this mean: “[removed]('<scr'+'ipt… ”?

前端 未结 6 1631
一向
一向 2020-12-03 07:25

I\'ve seen this on every Yahoo! news page, at the bottom of the source code,
and failed to understand why they break the script word like that.
<

6条回答
  •  忘掉有多难
    2020-12-03 07:58

    For a full discussion of this, see:
       http://www.wwco.com/~wls/blog/2007/04/25/using-script-in-a-javascript-literal/

    The short answer is that your code is parsed in two discrete steps.

    The first one is XML. And that means that the element . It's important to remember that XML elements are content agnostic. That means that the parser doesn't know yet that there's JavaScript in there.

    Once it has the contents of the

提交回复
热议问题