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

📄 ex11-19.htm

📁 《JAVASCRIPT 动态网页编程实例手册》一书中的源代码
💻 HTM
字号:
    <html><title>links对象应用演示 </title></head>
    <h2>链接对象及其属性 </h2>
    <body>
    <a href="http://www.google.com/search?q=javascript&ie=UTF-8&hl=zh-CN&lr=">
    使用Google搜索包含JavaScript的文档 </a><p>
    <a href="http://www.google.com" target="MyGoogle">使用Google搜索引擎</a><p>
    单击下图使用中文Yahoo搜索引擎 <br>
    <a href="http://cn.yahoo.com/"> 
    <img src="yahoo.gif"></a>
    <script language = "JavaScript">
        document.write("<br><b>本文档中的链接数量为:"
            +document.links.length + "<br></b>");
            for (i = 0; i< document.links.length; i++){
               document.write("<u><i><b>document.links["+i+"]:</b></i></u><br>");
               document.write("<b>hostname:</b> "+document.links[i].hostname +"<br>");
               document.write("<b>href: </b>"+document.links[i].href +"<br>");
               document.write("<b>pathname:</b>"+document.links[i].pathname +"<br>");
               document.write("<b>port:</b> "+document.links[i].port +"<br>");
               document.write("<b>query:</b> "+document.links[i].search +"<br>");
               document.write("<b>protocol:</b> "+document.links[i].protocol +"<br>");
               document.write("<b>target:</b> "+document.links[i].target +"<br><br>");
            }
    </script>
    </body>
    </html>

⌨️ 快捷键说明

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