⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 js_break.asp@output=print

📁 W3Schools tutorial..web designing
💻 ASP@OUTPUT=PRINT
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JavaScript Break and Continue Statements</title>
 
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />

<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

</head>

<body>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

<h1>JavaScript Break and Continue</h1>
<a href="js_loop_while.asp"><img alt="previous" border="0" src="../images/btn_previous.gif" width="100" height="20" /></a>
<a href="js_loop_for_in.asp"><img alt="next" border="0" src="../images/btn_next.gif" width="100" height="20" /></a>
<hr />
<p class="intro">There are two special statements that can be used inside loops: break and 
continue.</p>
<hr />

<h2>Examples</h2>
<p><a target="_blank" href="tryit.asp@filename=tryjs_break">Break statement</a><br />
Use the break statement to break the loop.</p>
<p><a target="_blank" href="tryit.asp@filename=tryjs_continue">Continue statement</a><br />
Use the continue statement to break the current loop and continue with the next value.</p>
<hr />

<h2>JavaScript break and continue Statements</h2>
<p>There are two special statements that can be used inside loops: break and 
continue.</p>
<h3><b>Break</b></h3>
<p>The break command will break the loop and continue executing the code that follows 
after the loop (if any).</p>
<p><b>Example</b></p>
<table class="ex" cellspacing="0" border="1" width="100%" id="table17">
    <tr>
      <td>
        <pre>&lt;html&gt;
&lt;body&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var i=0;
for (i=0;i&lt;=10;i++)
{
if (i==3)
{
break;
}
document.write(&quot;The number is &quot; + i);
document.write(&quot;&lt;br /&gt;&quot;);
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
      </td>
    </tr>
</table>
<p><b>Result</b></p>
<table class="ex" cellspacing="0" border="1" width="100%" id="table18">
    <tr>
      <td>
        <pre>The number is 0
The number is 1
The number is 2</pre>
      </td>
    </tr>
</table>
<h3><b>Continue</b></h3>
<p>The continue command will break the current loop and continue with the next 
value.</p>
<p><b>Example</b></p>
<table class="ex" cellspacing="0" border="1" width="100%" id="table21">
    <tr>
      <td>
        <pre>&lt;html&gt;
&lt;body&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var i=0
for (i=0;i&lt;=10;i++)
{
if (i==3)
{
continue;
}
document.write(&quot;The number is &quot; + i);
document.write(&quot;&lt;br /&gt;&quot;);
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
      </td>
    </tr>
</table>
<p><b>Result</b></p>
<table class="ex" cellspacing="0" border="1" width="100%" id="table22">
    <tr>
      <td>
        <pre>The number is 0
The number is 1
The number is 2
The number is 4
The number is 5
The number is 6
The number is 7
The number is 8
The number is 9
The number is 10</pre>
      </td>
    </tr>
</table>
<br />
<hr />
<a href="js_loop_while.asp"><img alt="previous" border="0" src="../images/btn_previous.gif" width="100" height="20" /></a>
<a href="js_loop_for_in.asp"><img alt="next" border="0" src="../images/btn_next.gif" width="100" height="20" /></a>


<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -