你怎么停止一个JavaScript程序? [英] How do you stop a javascript program?

查看:69
本文介绍了你怎么停止一个JavaScript程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行超出数组限制的程序时,它会发出

警报。我想在用空格填写输出

框之后停止程序。你如何停止该计划?

我已经工作了好几天并尝试搜索网络,但是没有找到



解决方案

我在搜索群组中停止javascript并找到答案。

答案是标记循环,然后使用break循环语句。


el ********* @ electrician.com 写道:


[已添加归因地址引用]

el ********* @ electrician.com 写道:

运行超出数组限制的程序时,它会发出
警报。我想在用空白填充输出框之后停止程序。你怎么停止这个计划?


你不会。

我已经工作了好几天并尝试搜索网络,但没有找到任何东西。



我jsut搜索组停止javascript并找到答案。
答案是标记循环然后使用break循环语句。



^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^

不,这完全是胡说八道。如果我正确理解你的OP,

,你没有引用BTW [1],你应该使用类似


var es = f.elements;

for(var i = 0,len = es.length; i< len; i ++)

{

// ... es [i] ...

}


假设`f''表示代表`form''元素的HTMLFormElement

你的输出框是控制。在哪里你应该知道你没有处理一个Array对象,而是使用HTMLCollection对象。

PointedEars

_________

[1]<网址:http://safalra.com/special/googlegroupsreply/>


问题是我搜索了一系列指挥安培数量,但是当达到数组末尾并且没有找到正确尺寸的导体

因为降额太高我需要停止时



程序并提醒用户输入较小的值并用空格填写所有

输出表格值并终止程序。我通过将一个标志设置为True来实现这个目的,然后通过运行
$ b $来打破外部

循环并使用break循环填充空白当标志为真时,b endprogram。它现在工作得很好。这是一个相当长的程序,而且我已经混淆了它,但是如果你想看到它

工作它是,
http://electrician.com/calculators/wireocpd_ver_1.html


While running a program that exceeds the array limits it issues an
alert. I want to then stop the program after filling in the output
boxes with blanks. How do you stop the program?
I have worked on this for days and tried searching the net, but have
found nothing.

解决方案

I jsut searched groups for stop javascript and found the answer. The
answer is to label loops and then use a break loop statement.


el*********@electrician.com wrote:

[Added attribution and quotation]

el*********@electrician.com wrote:

While running a program that exceeds the array limits it issues an
alert. I want to then stop the program after filling in the output
boxes with blanks. How do you stop the program?
You don''t.
I have worked on this for days and tried searching the net, but have
found nothing.



I jsut searched groups for stop javascript and found the answer.
The answer is to label loops and then use a break loop statement.


^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
No, this reads like utter nonsense. If I understood your OP correctly,
which you did not quote BTW[1], you should use something like

var es = f.elements;
for (var i = 0, len = es.length; i < len; i++)
{
// ... es[i] ...
}

Provided that `f'' refers to a HTMLFormElement representing a `form'' element
your "output boxes" are controls of. Where you should know that you are
not dealing with an Array object, but with an HTMLCollection object.
PointedEars
_________
[1] <URL:http://safalra.com/special/googlegroupsreply/>


The problem was that I searched an array of conductor ampacities, but
when the end of the array was reached and the right size conductor
could not be found because the derating was too high I needed to stop
the program and alert the user to enter smaller values and fill all the
output form values with blanks and terminate the program. I
accomplished this by setting a flag to True and broke out of the outer
loop with break loop then filled in the blanks by running the
endprogram when the flag is true. It works just fine, now. This is a
rather long program and I have obfuscated it, but if you want to see it
work it is at,
http://electrician.com/calculators/wireocpd_ver_1.html


这篇关于你怎么停止一个JavaScript程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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