Can't see dynamically loaded code in Chrome Developer Tools 22

后端 未结 5 1457
悲哀的现实
悲哀的现实 2021-01-31 09:46

When I dynamically load a snippet of html containing javascript via AJAX, I cannot see that content in the source tab in the developer tools window in Chrome 22.0.1229.94. Tell

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 10:07

    When you use a library or javascript code that you have loaded it dynamically, you can use the phrase

    //@ sourceURL=foo.js
    

    at the beginning of your javascript code that foo.js is the name that will be assigned it. debugger will show it with that name. This is true in chrome, and I think in firebug too. In this case you can place a breakpoint in the dynamically loaded javascript code.

提交回复
热议问题