Monday, June 3, 2024
131
rated 0 times [  133] [ 2]  / answers: 1 / hits: 32469  / 13 Years ago, fri, september 30, 2011, 12:00:00

When you get an infinite loop in jsfiddle in Chrome, your only choice (that I know of) is to close the tab. Of course, this means you lose all your work in the current window! Is there an easy way to stop an infinitely executing script?




  1. I have the developer tools open because I was doing some debugging.

  2. I am able to pause the script and step through the loop.

  3. I can't find anywhere to stop the script.

  4. I can't modify the script or variables to stop the infinite loop (because the script execution occurs in an iframe on a separate domain, so modifying data in the iframe with JavaScript is not allowed and generates an Exception in the console).



It all started because I decided to swap directions on my loop from



for (var c = 0; c <= 11; c++)


to



for (var c = 12; c > 0; c++)


But as you can see above, I forgot to change it from c++ to c--.



Any ideas?? I still have the tab open and I'm hoping to get it back without closing the tab :-)


More From » google-chrome

 Answers
10

With the developer mode, go into resources and find your script and copy and paste it into a text document or a new window. If you can't find it in resources, do a search for a variable or line of code you used.


[#89838] Thursday, September 29, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anniejulietteb

Total Points: 740
Total Questions: 125
Total Answers: 97

Location: Benin
Member since Fri, Mar 24, 2023
1 Year ago
anniejulietteb questions
;