?? tutorial4_page12.html
字號(hào):
</pre>
</td>
</tr>
<tr>
<td WIDTH="74%" VALIGN="MIDDLE" BGCOLOR="#ffffff"><font FACE="System,??" LANG="ZH-CN"><p
ALIGN="JUSTIFY">取得一個(gè)新的日期對(duì)象。就象你在用數(shù)組時(shí)取得一個(gè)新的<br>
數(shù)組一樣,在你要找出即時(shí)是什么時(shí)間時(shí)你需要先取得一<br>
個(gè)日期對(duì)象。當(dāng)找到了一個(gè)新的日期對(duì)象,它自動(dòng)重置到<br>
當(dāng)前的日期和時(shí)間。為了在對(duì)象以外得到這個(gè)信息,你必<br>
須使用這種對(duì)象方法:</p>
<p ALIGN="JUSTIFY">這些方法從日期對(duì)象上取得了合適的數(shù)字。</font></td>
</tr>
<tr>
<td WIDTH="74%" VALIGN="TOP" BGCOLOR="#ffffff"><pre>
var the_hour = the_date.getHours();
var the_minute = the_date.getMinutes();
var the_second = the_date.getSeconds();
</pre>
</td>
</tr>
<tr>
<td WIDTH="74%" VALIGN="MIDDLE" BGCOLOR="#ffffff"><font FACE="System,??" LANG="ZH-CN"><p
ALIGN="JUSTIFY">你可能疑惑:我怎樣能假定日期對(duì)象知道何種方式?甚或<br>
我如何知道有這樣一件事可作為日期對(duì)象?這些緣由應(yīng)從<br>
</font><font FACE="宋體" LANG="ZH-CN">Javascript </font><font FACE="System,??"
LANG="ZH-CN">庫(kù)中獲取,我將盡我所能解釋內(nèi)置</font><font FACE="宋體"
LANG="ZH-CN">Javascript</font><font FACE="宋體" LANG="ZH-CN" SIZE="2"><br>
</font><font FACE="System,??" LANG="ZH-CN">對(duì)象,但不一定能徹底的使你清楚。</p>
</font><font FACE="System,??" LANG="ZH-CN" SIZE="4"><p ALIGN="JUSTIFY">函數(shù)的其他部分就很清楚了。它以這種方式調(diào)用<br>
返回?cái)?shù)字,把它們變成字符串,并且調(diào)用警告方<br>
式以彈出一個(gè)字符串對(duì)話框。注意你可以在函數(shù)<br>
內(nèi)部調(diào)用一個(gè)方式和函數(shù)。我們將詳盡討論。</p>
</font><font FACE="System,??" LANG="ZH-CN"><p ALIGN="JUSTIFY">現(xiàn)在如果你也玩透了時(shí)間鏈接,你可能注意到了有些什么<br>
不對(duì)的事。你每次可能會(huì)得到這樣的反饋:</font><font FACE="System,??"
LANG="ZH-CN" SIZE="2">“</font><font FACE="宋體" LANG="ZH-CN">12:12:04</font><font
FACE="System,??" LANG="ZH-CN">”,<br>
這是</font><font FACE="宋體" LANG="ZH-CN">getSecond()</font><font FACE="System,??"
LANG="ZH-CN">將返回值為“</font><font FACE="宋體" LANG="ZH-CN">4</font><font
FACE="System,??" LANG="ZH-CN">”。那么當(dāng)你合成為時(shí)間<br>
時(shí),你看到的就是</font><font FACE="宋體" LANG="ZH-CN">the_minute+</font><font
FACE="System,??" LANG="ZH-CN">“</font><font FACE="宋體" LANG="ZH-CN">:</font><font
FACE="System,??" LANG="ZH-CN">”</font><font FACE="宋體" LANG="ZH-CN">+the_second</font><font
FACE="System,??" LANG="ZH-CN">得到</font><font FACE="宋體" LANG="ZH-CN">14:4</font><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
</font><font FACE="System,??" LANG="ZH-CN">而非是我們想要的。解決它是個(gè)容易的事,需要個(gè)新的函<br>
數(shù)來(lái)修補(bǔ)分、秒合成值。</p>
<p ALIGN="JUSTIFY">請(qǐng)看<a HREF="tutorial4_page13.htm">參數(shù)及返回值</a><nobr>。</nobr></font></td>
</tr>
<tr>
<td WIDTH="74%" VALIGN="TOP" BGCOLOR="#ffffff"><!-- PAGE X LINKS --><!-- this stuff checks if there are more pages in this story. if so, we'llsuck out the titles of those pages and build links. Right now, the maximum is15 pages. --><!-- this is a mini-template that formats each pageX link. So, if a storyhas 15 pages, we need to generate 15 links to it. This is how each onewill look... --> <!-- PAGE X LINKS --><!-- this stuff checks if there are more pages in this story. if so, we'll
suck out the titles of those pages and build links. Right now, the maximum is
15 pages. --><font FACE="System,??" LANG="ZH-CN">第</font><font
FACE="宋體" LANG="ZH-CN">1</font><font FACE="System,??" LANG="ZH-CN">頁(yè)</font><font
FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a HREF="tutorial4.htm"><font
FACE="System,??" LANG="ZH-CN">第四課介紹</font></a><font FACE="System,??"
LANG="ZH-CN" SIZE="2"><br>
<!-- PAGE X LINKS --><!-- this stuff checks if there are more pages in this story. if so, we'll
suck out the titles of those pages and build links. Right now, the maximum is 15 pages. --><!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">2</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page2.htm"><font FACE="System,??" LANG="ZH-CN">循環(huán)介紹</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">3</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page3.htm"><font FACE="System,??" LANG="ZH-CN">循環(huán)的密碼</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">4</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page4.htm"><font FACE="System,??" LANG="ZH-CN">再談</font><font
FACE="宋體" LANG="ZH-CN">WHILE</font><font FACE="System,??" LANG="ZH-CN">循環(huán)</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">5</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page5.htm"><font FACE="宋體" LANG="ZH-CN">For </font><font
FACE="System,??" LANG="ZH-CN">循環(huán)</font></a><font FACE="System,??" LANG="ZH-CN"
SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">6</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page6.htm"><font FACE="System,??" LANG="ZH-CN">嵌套循環(huán)</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">7</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page7.htm"><font FACE="System,??" LANG="ZH-CN">循環(huán)練習(xí)</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">8</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page8.htm"><font FACE="System,??" LANG="ZH-CN">數(shù)組</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">9</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page9.htm"><font FACE="System,??" LANG="ZH-CN">數(shù)組和循環(huán)</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">10</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">:</font><a
HREF="tutorial4_page10.html"><font FACE="System,??" LANG="ZH-CN">文件目標(biāo)模塊中的數(shù)組</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">11</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page11.htm"><font FACE="System,??" LANG="ZH-CN">函數(shù)</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">12</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page12.html"><font FACE="System,??" LANG="ZH-CN">無(wú)參數(shù)函數(shù)</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">13</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page13.htm"><font FACE="System,??" LANG="ZH-CN">參數(shù)及返回值</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="System,??" LANG="ZH-CN">第</font><font FACE="宋體" LANG="ZH-CN">14</font><font
FACE="System,??" LANG="ZH-CN">頁(yè)</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page14.htm"><font FACE="System,??" LANG="ZH-CN">多于一個(gè)參數(shù)的函數(shù)</font></a><font
FACE="System,??" LANG="ZH-CN" SIZE="2"><br>
<!-- this is a mini-template that formats each pageX link. So, if a story
has 15 pages, we need to generate 15 links to it. This is how each one
will look... --> </font><font FACE="宋體" LANG="ZH-CN" SIZE="2"><p><br>
<!-- AUTHOR TAGLINE --> </font></td>
</tr>
<tr>
<td WIDTH="74%" VALIGN="MIDDLE"></td>
</tr>
</table>
<font FACE="System,??" LANG="ZH-CN">
<p> </p>
</font>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -