?? tutorial4_page11.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">函數(shù)</font></strong><font size="2"><p ALIGN="JUSTIFY"></font><font SIZE="3">函數(shù)是編程需學(xué)的最后一個(gè)基本組成。所有的程序語言都是<br>
函數(shù)。函數(shù)是一些角次可調(diào)用的、無須重寫的東西。</p>
<p ALIGN="JUSTIFY">如果你想教會(huì)自己快速閱讀并且用一個(gè)一旦點(diǎn)擊可告訴你當(dāng)前<br>
時(shí)間的長文本鏈接。</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('現(xiàn)在時(shí)間是: ' + the_time);">時(shí)間!</a></p>
<p ALIGN="JUSTIFY">看源碼:</font></p>
<p ALIGN="JUSTIFY"><font face="宋體"><br>
<a href="#" onClick="<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);">time!</a><br>
<br>
</font></p>
<p ALIGN="JUSTIFY"><font SIZE="3">在這里這段<font face="宋體">JavaScript</font>的工作細(xì)節(jié)并不重要;一會(huì)我們再回來<br>
復(fù)習(xí)一下。<font size="2"></p>
<p ALIGN="JUSTIFY"></font>重要的是它太長了。若這些時(shí)間鏈接再有<font
face="宋體">10</font>個(gè),你須每次剪貼<br>
這段程序。這使你的<font face="宋體">HTML</font>既長且難看。另外,若你想改變這段<br>
程序,就必須在<font face="宋體">10</font>個(gè)不同地方改變。<font size="2"></p>
<p ALIGN="JUSTIFY"></font>你可以寫一個(gè)函數(shù)來執(zhí)行而不用作<font face="宋體">10</font>次拷貝程序。這里的函數(shù)<br>
使用變的即容易編輯又容易閱讀。<font size="2"></p>
<p ALIGN="JUSTIFY"></font>請看如何寫一段<a href="tutorial4_page12.html">計(jì)時(shí)函數(shù)</a>。</font></td>
</tr>
<tr>
<td width="153" valign="bottom" align="left"></td>
</tr>
</table>
</div>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -