在jsfiddle中取消无限循环执行 [英] Cancel infinite loop execution in jsfiddle

查看:117
本文介绍了在jsfiddle中取消无限循环执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您在Chrome中的jsfiddle中遇到无限循环时,您唯一的选择(我知道)是关闭选项卡。当然,这意味着你在当前窗口中失去了所有的工作!有没有简单的方法来停止无限执行的脚本?

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. 我有开发工具打开,因为我正在做一些调试。 >
  2. 我可以暂停脚本并遍历循环。
  3. 我找不到任何地方停止脚本。

  4. 我无法修改脚本或变量来停止无限循环(因为脚本执行发生在独立域上的iframe中,因此不允许使用JavaScript修改iframe中的数据,并在控制台中生成一个Exception )。

这一切都是因为我决定从我的循环中交换指令

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++)

但是正如您在上面看到的,我忘记将它从 c ++ to 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 :-)

推荐答案

模式,进入资源并找到您的脚本,并将其复制并粘贴到文本文档或新窗口中。如果您无法在资源中找到它,请搜索您使用的变量或一行代码。

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.

这篇关于在jsfiddle中取消无限循环执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆