posts - 82, comments - 269, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          用JS從URL中取回參數

          Posted on 2007-11-06 08:39 itspy 閱讀(275) 評論(0)  編輯  收藏

          function gup( name ){ 
          name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 
          var regexS = "[\\?&]"+name+"=([^&#]*)"; 
          var regex = new RegExp( regexS ); 
          var results = regex.exec( window.location.href ); 
          if( results == null )    return "";  else    return results[1];
          }


          var frank_param = gup( 'frank' );

          alert(frank_param);


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 夏河县| 延吉市| 永州市| 南阳市| 延津县| 湟中县| 裕民县| 天镇县| 左权县| 长治市| 大方县| 蒙城县| 庄河市| 巴彦淖尔市| 望奎县| 石台县| 奎屯市| 天台县| 和顺县| 永修县| 丰原市| 合阳县| 四会市| 永和县| 新乡县| 兴义市| 白城市| 璧山县| 宣武区| 沙田区| 邢台县| 南宫市| 内丘县| 青铜峡市| 温州市| 建阳市| 通许县| 孙吴县| 鸡东县| 关岭| 江达县|