Stop IE from loading dynamically included script twice

前端 未结 6 2037
孤街浪徒
孤街浪徒 2020-12-01 16:49

I am including some related content on misc. web pages by adding a

6条回答
  •  旧巷少年郎
    2020-12-01 17:19

    The root difference is that IE executes a script element the first time it is added to a parent element's childNodes, regardless of whether the parent element is actually in the document. Other browsers only execute script when it is added to a node inside the document's tree of childNodes.

    jQuery's domManip function (line 524 of jQuery 1.3.2), which is called by append and other similar jQuery methods, tries to be clever and calls evalScript for any

提交回复
热议问题