How can I locate and debug a specific file in IE11 Dev Tools?

偶尔善良 提交于 2019-12-10 10:27:42

问题


I have a file that is part of a legacy web site I'm maintaining that I need to debug - step into, etc. But I can't see how to do that. The site needs to be run in IE, in Compatibility mode.

When I run the site from VS (2013) by right-clicking the "http://localhost/..." item beneath the solution and selecting "View in Browser (Internet Explorer" and then hit F12, I see on the Debugger tab the file that has been set as the Default page (the "main" page I see after logging in), but from there I don't see how to open a different file - the one I need to debug.

There are a handful of files apparently available for selection beneath the folder icon:

...but not the one I need. If I enter its name in the search box, I get, "No results found." It is beneath a pages folder, but so are those that are displayed. What makes them special? Why can I select those undesirables, but cannot select the only page I care about?


回答1:


I assume you have the JavaScript file you want to debug somewhere in dist. Just go to that file and write debugger; inside the function you want to debug. The open dev tools in IE and reload the page. Initiate an action that should invoke that function with debugger (if it was not done on page load) and you will be able to debug it.



来源:https://stackoverflow.com/questions/42542812/how-can-i-locate-and-debug-a-specific-file-in-ie11-dev-tools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!