简体   繁体   中英

Is there a way to pause a stuck script in the chrome debugger?

Occasionally, while programming JavaScript, I will make a bone headed mistake and can get the page stuck in an infinite loop while it is loading. I typically will use Chrome for this and, when I get in this state, I cannot do anything with the javascript developer tools. What I would really like is a break command similar to what can be done within Visual Studio's debugger that will pause the interpreter and display the current line being executed along with the call stack. Is there any such functionality available.

As an alternative to this, I would be handy to set break points in the code. Regardless, I need some way to interrupt the process so that I can determine the cause of the lock-up.

you can add a debugger; statement somewhere in your code where you want to break execution and continue stepping from there on with the Step Next, Step Over, etc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM