How to add breakpoints in your inline javascript in chrome

前端 未结 3 1347
旧时难觅i
旧时难觅i 2021-01-31 20:31

I want to debug my javascript code and able to successfully place breakpoints at required places under sources tab.

However, I have run into an issue where I want to de

3条回答
  •  北海茫月
    2021-01-31 20:44

    Another way can be using the dynamic script method. Chrome provides simple parser command which can tag dynamically loaded JS.

    
    

    This line tells the chrome debugger that this whole script inside the script tag should be interpreted as a dynamicScript.js file. You can find the file on the debugger list and easily set up breakpoints or check the code.

    Note : @ is replaced by # to avoid errors on unsupported browsers

    Breakpoints in Dynamic JavaScript

提交回复
热议问题