日期:2014-05-16  浏览次数:20293 次

js的停止运行函数是什么?
运行到一段,退出,用什么?
不是在函数里

------解决方案--------------------
document.execCommand("stop")
http://topic.csdn.net/t/20020528/10/758441.html
http://www.lty0311.com/article/rang-JS-tingzhizhihang-tingzhijiaobenzhihang-qudiao-free-space-deguanggao_17.html
------解决方案--------------------
主动抛出一个异常也可以。
JScript code
alert("before error.");
throw SyntaxError();
alert("after error.");

------解决方案--------------------
加个debugger;
------解决方案--------------------
不在函数内,这个还真不知道。
1楼说的:document.execCommand("stop")
你看能不能用,这可能跟浏览器相关吧。
------解决方案--------------------
探讨

document.execCommand("stop")
ie下没有用,ff下可以用

------解决方案--------------------
函数中用reture可以退出
循环中用break可以退出