Web effects continue methods to terminate the current loop
The continue command terminates the current loop and then continues running from the next value.
Instance:
<script language= ' JavaScript ' >
<!--
Outerloop:
for (var i1 = 1; i1 <= 2; i1++)
{
document.write ("Top of outerloop.<br>");
Innerloop:
for (var i2 = 1; i2 <= 2; i2++) {
document.write ("Top of innerloop.<br>");
document.write ("i1=", I1, "<BR>");
document.write ("i2=", I2, "<BR>");
if (I2 = 2)
{
document.write ("Continue at top of innerloop.<br>");
Continue
}
if (I1 = 2)
{
document.write ("Continue at top of outerloop.<br>");
Continue Outerloop;
}
document.write ("Bottom of Innerloop.<br>");
}
document.write ("Bottom of Outerloop.<br>");
}
document.write ("All done!");
-->
</SCRIPT>
Jump out of the loop
<title>a Simple page</title>
<script language= "JavaScript" >
<!--
var x = 0;
while (x < 10)
{
x + +;
document.write (x);
Continue
document.write ("You never to this!");
}
-->
</script>
<body>
</body>
Example Two
<script language= "JavaScript"
<!--
var x = 0;
while (X < ten)
{
&NBSP;&N bsp; x + +;
if (x 2 = 0)
{
continue;
}
document.write (x);
}
//
</script>