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

📄 day2_4.html

📁 JAVASCRIPT 高级编程
💻 HTML
📖 第 1 页 / 共 2 页
字号:
    <td colspan="2" align="center" bgcolor="#666699"><a href="../../1-download/index.htm"><font color="#FFFFFF">网猴下载</font></a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-download/page1.htm">网页制作</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<font color="#000000"><a href="../../1-download/page2.htm">程序设计</a></font></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<font color="#000000"><a href="../../1-download/page3.htm">网站设计</a></font></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<font color="#000000"><a href="../../1-download/page4.htm">电子商务</a></font> 
    </td>
  </tr>
  <tr> 
    <td colspan="2" align="center" bgcolor="#666699"><a href="../../1-teach/index.htm"><font color="#FFFFFF">实用技巧</font></a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/internet/index.htm">Internet应用</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/photoshop/index.html">Photoshop</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/flash/page1.html">Flash</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/asp/index.html">ASP</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/php/index.html">PHP</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/java/index.htm">Java</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/vb/index.htm">VB</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/c/index.htm">C、C++</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-backend/database/php_mysql/index.html">PHP/MySQL</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2"><a href="../../1-backend/cgi_perl/perl_beginner/index.html">-Perl</a> 
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2">-<a href="../../1-teach/other/index.htm">其它</a> </td>
  </tr>
  <tr> 
    <td colspan="2" bgcolor="#666699"> 
      <div align="center"><font color="#FFFFFF">更多教程</font></div>
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="17"><a href="../../1hdml/index.html">-HDML</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="23"><font face="宋体"><a href="../../1-backend/database/course/day1_1.html">-网络数据库</a></font></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="14"><a href="../../1-backend/protocols/ping/index.html"><font face="arial, helvetica, sans-serif">-ping</font></a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="20"><a href="../../1-backend/cgi_perl/search_engine/index.html">-创建搜索引擎</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="16">-<a href="../../1adobe/GoLive/index.html">Adobe GoLive</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2"><a href="../../1-backend/cgi_perl/templates/index.html">-模板</a></td>
  </tr>
  <tr bgcolor="#666699"> 
    <td colspan="2" align="center"><font color="#FFFFFF">合作伙伴</font></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" align="left">-<a href="http://www.5dmedia.com/" target="_blank">5D精英网</a></td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF"> 
    <td colspan="2"> <img src="../../Library/front_monkey.gif" width="59" height="68"></td>
  </tr>
  </tbody> 
</table>
<!-- #EndLibraryItem --> </td>
 <!-- End of headlines (column 1: left column) --> <!-- Gutter between columns 1 and 2 --> 
 <td width="10" height="794"><img src="http://www.sohu.com/images/pixel.gif" width=10></td>
 <!-- Search box and directories (columns 2 and 3: middle columns, combined into one) --> 
 <td align=center valign=top width="558"> 
 <div align="left"><!-- #BeginEditable "1" --> 
<title>JavaScrip高级教程</title>
 <strong>第四页:分割方法(splitting method)</strong> 
      <p>你可以使用split方法用限位器来分割一系列的名称,然后将其<br>
        放在一个数组中.例如:</p>
      <p>var my_friends =<br>
        &quot;trixie,moxie,sven,guido,hermes&quot;;<br>
        <br>
        var friend_array =<br>
        my_friends.split(&quot;,&quot;);<br>
        <br>
        for (loop=0; loop &lt; friend_array.length;<br>
        loop++)<br>
        <br>
        {<br>
        <br>
        &nbsp;&nbsp;&nbsp; document.writeln(friend_array[loop] + &quot; is my<br>
        friend.&lt;br&gt;&quot;);<br>
        <br>
        }</p>
      <p>这段代码将字符串my_friends分割成包含5个元素的数组.<br>
        JavaScript可以为你自动建立一个数组,所以你无需使用<br>
        new Array().</p>
      <p>将字符串分割成数组之后,我们使用了循环语句写出每一个<br>
        名称.我们可以利用split方法简化前面所讲到的域名提取:</p>
      <p>var the_url = prompt(&quot;What's the URL?&quot;,&quot;&quot;);<br>
        <br>
        var first_split = the_url.split(&quot;//&quot;);<br>
        <br>
        var without_resource = first_split[1];<br>
        <br>
        var second_split = without_resource.split(&quot;/&quot;);<br>
        <br>
        var domain = second_split[0];</p>
      <p>这段代码简化了很多而且也更容易理解.我们来分析一些这段<br>
        代码:</p>
      <p>var the_url = prompt(&quot;What's the URL?&quot;,&quot;&quot;); </p>
      <p>提示用户输入一个URL,假设用户输入<br>
        &quot;http://www.webmonkey.com/javascript/index.html&quot; .<br>
        var first_split = the_url.split(&quot;//&quot;); <br>
        将用户输入的字符串分割成两块:first_split[0]是&quot;http:&quot;,<br>
        first_split[1]是<br>
        &quot;www.webmonkey.com/javascript/index.html.&quot; <br>
        var without_resource = first_split[1]; <br>
        提取出数组中的第2个元素,所以现在without_resource是<br>
        &quot;www.webmonkey.com/javascript/index.html.&quot; <br>
        var second_split = without_resource.split(&quot;/&quot;); <br>
        将without_resource分割成3块:www.webmonkey.com,<br>
        javascript, 和index.html.现在你可以看到split的用途了吧?<br>
        var domain = second_split[0]; <br>
        现在我们提取出新数组中的第1个元素就可得出域名.</p>
      <p>接下来我们将学习相关数组的概念,然后我们就正式开始学习<br>
        神奇的cookie.<a href="day2_5.html">&gt;&gt;</a></p>
      <p><font face="宋体" size="3" color="#000000"><strong>JavaScript高级教程</strong></font><font color="#FF0000" face="宋体" size="3"><br>
        </font><font color="#FF0000">第一页</font> <a href="day2_1.html">Javascript高级教程-第2日</a><br>
        <font color="#FF0000">第二页</font> <a href="day2_2.html">神奇的字符串处理</a><br>
        <font color="#FF0000">第三页</font> <a href="day2_3.html">子字符串</a><br>
        <font color="#FF0000">第四页</font> 分割方法(splitting method)<br>
        <font color="#FF0000">第五页</font> <a href="day2_5.html">相关数组</a><br>
        <font color="#FF0000">第六页</font> <a href="day2_6.html">相关数组的一个例子</a><br>
        <font color="#FF0000">第七页</font> <a href="day2_7.html">介绍cookie</a><br>
        <font color="#FF0000">第八页</font> <a href="day2_8.html">深入了解cookies</a><br>
        <font color="#FF0000">第九页</font> <a href="day2_9.html">读取cookies</a><br>
        <font color="#FF0000">第十页</font> <a href="day2_10.html">复杂的cookies读取</a><br>
        <font color="#FF0000">第十一页</font> <a href="day2_11.html">读取和编写多重cookies</a><br>
        <font color="#FF0000">第十二页</font> <a href="day2_12.html">再次深入了解cookies</a><br>
        <font color="#FF0000">第十三页</font> <a href="day2_13.html">cookie路径和域</a></p>
      <p><font size="3">[<a href="day1_1.html">第1课</a>][第2课][<a href="day3_1.html">第3课</a>][<a href="day4_1.html">第4课</a>][<a href="day5_1.html">第5课</a>]</font></p>
      <!-- #EndEditable --></div>
 </td>
 <!-- End of search box and directories (columns 2 and 3: middle columns, combined into one) --> 
 <!-- Gutter between columns 3 and 4 --> <!-- Other stuff (column 4: right column) --> 
 <!-- End of other stuff (column 4: right column) --> </tr>
 </table>
<!-- End of table surrounding page contents -->

 <hr noshade size=1 width=700>
 <span class=eng><br>
 Copyright (C) 1998-2000 Internet Technologies China.&nbsp; All rights reserved. 
 </span> 
</center>
</body>
<!-- #EndTemplate --></html>

⌨️ 快捷键说明

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