Home  >  Article  >  Web Front-end  >  How to debug js files contained in asynchronously loaded pages_javascript skills

How to debug js files contained in asynchronously loaded pages_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:32:391222browse

Recently developing functionality in a new web project. The management interface of this project has a feature. The frame is fixed and will not be refreshed. Each time a new page is clicked, only one div is refreshed. There is no iframe inside the div, which leads to a problem. The browser cannot debug the js file contained in the asynchronously loaded page. To put it simply, the js files included in the asynchronous loading page cannot be seen in the debugging tool.

I found a solution online, which is to add a line of code at the top of the js file that needs to be debugged:

//@ sourceURL=msgprompt.js

Note that there must be a space between the @ symbol and sourceURL. Effect under Chrome:

It is also OK under FireFox. This method is not bad.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn