?? tutorial4_page12.html
字號:
</pre>
</td>
</tr>
<tr>
<td WIDTH="74%" VALIGN="MIDDLE" BGCOLOR="#ffffff"><font FACE="System,??" LANG="ZH-CN"><p
ALIGN="JUSTIFY">取得一個新的日期對象。就象你在用數組時取得一個新的<br>
數組一樣,在你要找出即時是什么時間時你需要先取得一<br>
個日期對象。當找到了一個新的日期對象,它自動重置到<br>
當前的日期和時間。為了在對象以外得到這個信息,你必<br>
須使用這種對象方法:</p>
<p ALIGN="JUSTIFY">這些方法從日期對象上取得了合適的數字。</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">你可能疑惑:我怎樣能假定日期對象知道何種方式?甚或<br>
我如何知道有這樣一件事可作為日期對象?這些緣由應從<br>
</font><font FACE="宋體" LANG="ZH-CN">Javascript </font><font FACE="System,??"
LANG="ZH-CN">庫中獲取,我將盡我所能解釋內置</font><font FACE="宋體"
LANG="ZH-CN">Javascript</font><font FACE="宋體" LANG="ZH-CN" SIZE="2"><br>
</font><font FACE="System,??" LANG="ZH-CN">對象,但不一定能徹底的使你清楚。</p>
</font><font FACE="System,??" LANG="ZH-CN" SIZE="4"><p ALIGN="JUSTIFY">函數的其他部分就很清楚了。它以這種方式調用<br>
返回數字,把它們變成字符串,并且調用警告方<br>
式以彈出一個字符串對話框。注意你可以在函數<br>
內部調用一個方式和函數。我們將詳盡討論。</p>
</font><font FACE="System,??" LANG="ZH-CN"><p ALIGN="JUSTIFY">現在如果你也玩透了時間鏈接,你可能注意到了有些什么<br>
不對的事。你每次可能會得到這樣的反饋:</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">”。那么當你合成為時間<br>
時,你看到的就是</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">而非是我們想要的。解決它是個容易的事,需要個新的函<br>
數來修補分、秒合成值。</p>
<p ALIGN="JUSTIFY">請看<a HREF="tutorial4_page13.htm">參數及返回值</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">頁</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page2.htm"><font FACE="System,??" LANG="ZH-CN">循環介紹</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page3.htm"><font FACE="System,??" LANG="ZH-CN">循環的密碼</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">頁</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">循環</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">頁</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">循環</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page6.htm"><font FACE="System,??" LANG="ZH-CN">嵌套循環</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page7.htm"><font FACE="System,??" LANG="ZH-CN">循環練習</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page8.htm"><font FACE="System,??" LANG="ZH-CN">數組</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page9.htm"><font FACE="System,??" LANG="ZH-CN">數組和循環</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">:</font><a
HREF="tutorial4_page10.html"><font FACE="System,??" LANG="ZH-CN">文件目標模塊中的數組</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page11.htm"><font FACE="System,??" LANG="ZH-CN">函數</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page12.html"><font FACE="System,??" LANG="ZH-CN">無參數函數</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page13.htm"><font FACE="System,??" LANG="ZH-CN">參數及返回值</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">頁</font><font FACE="宋體" LANG="ZH-CN" SIZE="2">: </font><a
HREF="tutorial4_page14.htm"><font FACE="System,??" LANG="ZH-CN">多于一個參數的函數</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>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -