<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      javascript獲取當前url

      在WEB開發中,許多開發者都比較喜歡使用javascript來獲取當前url網址,本文就此為大家總結一下比較常用獲取URL的javascript實現代碼,以下示例是前面為相應實現方法,后面是獲取URL的效果,下面以例子講解:

      輸入的網址是(沒有框架):http://localhost:81/Test/1.htm?Did=123
      <br>以下為輸出:
      <br>
      <SCRIPT>

      //獲取Url傳過來的值
      function Request(name)
      {
           new RegExp("(^|&)"+name+"=([^&]*)").exec(window.location.search.substr(1));
           return RegExp.$2
      }

       

      注意:RegExp 是javascript中的一個內置對象。為正則表達式。
      RegExp.$1是RegExp的一個屬性,指的是與正則表達式匹配的第一個 子匹配(以括號為標志)字符串,以此類推,RegExp.$2,RegExp.$3,..RegExp.$99總共可以有99個匹配
      給你看了例子就知道了
      var r= /^(\d{4})-(\d{1,2})-(\d{1,2})$/; //正則表達式 匹配出生日期(簡單匹配)
      r.exec('1985-10-15');
      s1=RegExp.$1;
      s2=RegExp.$2;
      s3=RegExp.$3;
      alert(s1+" "+s2+" "+s3)//結果為1985 10 15

      thisURL = document.URL;     // http://localhost:81/Test/1.htm?Did=123
      thisHREF = document.location.href; // http://localhost:81/Test/1.htm?Did=123
      thisSLoc = self.location.href;   // http://localhost:81/Test/1.htm?Did=123
      thisDLoc = document.location;   // http://localhost:81/Test/1.htm?Did=123

      thisTLoc = top.location.href;   // http://localhost:81/Test/1.htm?Did=123
      thisPLoc = parent.document.location;// http://localhost:81/Test/1.htm?Did=123
      thisTHost = top.location.hostname; // localhost
      thisHost = location.hostname;   // localhost

      thisU1 = window.location.protocol; // http:
      thisU2 = window.location.host;   // localhost:81
      thisU3 = window.location.pathname; // /Test/1.htm

      document.writeln( thisURL + "<br />");
      document.writeln( thisHREF + "<br />");
      document.writeln( thisSLoc + "<br />");
      document.writeln( thisDLoc + "<br />");

      document.writeln( thisTLoc + "<br />");
      document.writeln( thisPLoc + "<br />");
      document.writeln( thisTHost + "<br />");
      document.writeln( thisHost + "<br />");

      document.writeln( thisU1 + "<br />");
      document.writeln( thisU2 + "<br />");
      document.writeln( thisU3 + "<br />");

      document.writeln( "Did="+Request("Did") );// Did=123
      </SCRIPT>

      posted @ 2013-12-27 09:49  nd  閱讀(64260)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲欧美另类激情综合区蜜芽| 男女猛烈无遮挡免费视频| 亚洲日韩一区二区| 一本色道久久加勒比综合| 亚洲国产成人久久综合区| 亚洲精品一区二区三区在| 果冻传媒18禁免费视频| 亚洲小说乱欧美另类| 国产特级毛片AAAAAA视频| 亚洲AV永久无码嘿嘿嘿嘿| 久久中文字幕av第二页| 丰满爆乳一区二区三区| 国产福利酱国产一区二区| 亚洲AV无码成人网站久久精品| 成人精品自拍视频免费看| 欧洲免费一区二区三区视频| 噜噜噜噜私人影院| 激情的视频一区二区三区| 亚洲色大成网站www永久男同| 国产精品白浆免费视频| 欧美国产精品不卡在线观看| 亚洲人成网站在线播放动漫| 一区二区福利在线视频| 色婷婷综合久久久中文字幕| 91亚洲国产成人精品性色| 一区二区亚洲人妻精品| 怡红院一区二区三区在线| 伊人久久大香线蕉综合网| 国产一级三级三级在线视| 日韩成人一区二区三区在线观看 | 国产成熟女人性满足视频| 久久精品国产国产精品四凭| 亚洲国产在一区二区三区| 亚洲国产精品综合久久2007| 国产精品毛片一区视频播| 人成午夜免费大片| 色狠狠色噜噜AV一区| 免费国产一区二区不卡| 安康市| 国产精品一区二区色综合| 免费无码成人AV片在线|