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

📄 tutorial4_page11.htm

📁 一本很好的java script 教程
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312-80">
<style type="text/css">
<!--

a:link {  color: blue; text-decoration: none}

a:visited {  color: purple; text-decoration: none}

a:hover {  color: #CC0033; text-decoration: underline}

-->

</style>
<title>JavaScript教程</title>
</head>

<body topmargin="1" leftmargin="2">
<div align="left">

<table border="0" width="630" cellspacing="0">
  <tr>
    <td width="458" valign="top" align="left" rowspan="2"><strong><font face="宋体" size="3">第十一页:</font><font
    SIZE="3">函数</font></strong><font size="2"><p ALIGN="JUSTIFY"></font><font SIZE="3">函数是编程需学的最后一个基本组成。所有的程序语言都是<br>
    函数。函数是一些角次可调用的、无须重写的东西。</p>
    <p ALIGN="JUSTIFY">如果你想教会自己快速阅读并且用一个一旦点击可告诉你当前<br>
    时间的长文本链接。</p>
    <p ALIGN="JUSTIFY">例如…<a href="#"
    onClick="



	var the_date = new Date();



	var the_hour = the_date.getHours();



	var the_minute = the_date.getMinutes();



	var the_second = the_date.getSeconds();



	var the_time = the_hour + ':' + the_minute + ':' + the_second;



	alert('现在时间是: ' + the_time);">时间!</a></p>
    <p ALIGN="JUSTIFY">看源码:</font></p>
    <p ALIGN="JUSTIFY"><font face="宋体"><br>
    &lt;a href=&quot;#&quot; onClick=&quot;<br>
    <br>
    var the_date = new Date();<br>
    <br>
    var the_hour = the_date.getHours();<br>
    <br>
    var the_minute = the_date.getMinutes();<br>
    <br>
    var the_second = the_date.getSeconds();<br>
    <br>
    var the_time = the_hour + ':' + the_minute + ':' + the_second;<br>
    <br>
    alert('The time is now: ' + the_time);&quot;&gt;time!&lt;/a&gt;<br>
    <br>
    </font></p>
    <p ALIGN="JUSTIFY"><font SIZE="3">在这里这段<font face="宋体">JavaScript</font>的工作细节并不重要;一会我们再回来<br>
    复习一下。<font size="2"></p>
    <p ALIGN="JUSTIFY"></font>重要的是它太长了。若这些时间链接再有<font
    face="宋体">10</font>个,你须每次剪贴<br>
    这段程序。这使你的<font face="宋体">HTML</font>既长且难看。另外,若你想改变这段<br>
    程序,就必须在<font face="宋体">10</font>个不同地方改变。<font size="2"></p>
    <p ALIGN="JUSTIFY"></font>你可以写一个函数来执行而不用作<font face="宋体">10</font>次拷贝程序。这里的函数<br>
    使用变的即容易编辑又容易阅读。<font size="2"></p>
    <p ALIGN="JUSTIFY"></font>请看如何写一段<a href="tutorial4_page12.html">计时函数</a>。</font></td>
  </tr>
  <tr>
    <td width="153" valign="bottom" align="left"></td>
  </tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

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