• JS取得不同连接的地址,并打开新窗口


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8" />
      <title>Example</title>
    <script type="text/JavaScript">
    window.onload = function() {
      if (!document.getElementsByTagName) return false;
      var lnks = document.getElementsByTagName("a");
      for (var i=0; i<lnks.length; i++) {
        if (lnks[i].getAttribute("class") == "popup") {
          lnks[i].onclick = function() {
            popUp(this.getAttribute("href"));
            return false;
          }
        }
      }
    }
    
    function popUp(winURL) {
      window.open(winURL,"popup","width=320,height=480");
    }
    
    </script>
    </head>
    <body>
    <a href="http://www.example.com/" class="popup">Example</a>
    </body>
    </html>
  • 相关阅读:
    【BZOJ 5000 OI树】
    九、表锁
    八、ORDER BY优化
    七、索引优化分析
    六、JVM之垃圾回收
    五、JVM之堆内存
    四、JVM之栈与栈帧
    三、JVM之方法区
    二、JVM之体系结构
    一、JVM之类加载器
  • 原文地址:https://www.cnblogs.com/findumars/p/3164228.html
Copyright © 2020-2023  润新知