Can't append [removed] element

后端 未结 18 2264
被撕碎了的回忆
被撕碎了的回忆 2020-11-21 06:11

Any idea why the piece of code below does not add the script element to the DOM?

var code = \"\";
$(\"#someElement\").append(cod         


        
18条回答
  •  眼角桃花
    2020-11-21 06:44

    Adding the sourceURL in the script file helped as mentioned in this page: https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/

    1. In the script file, add a statement with sourceURL like "//@ sourceURL=foo.js"
    2. Load the script using jQuery $.getScript() and the script will be available in "sources" tab in chrome dev tools

提交回复
热议问题