📄 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 + -