现在的位置: 首页 > 综合 > 正文

js获取浏览器的参数

2012年10月01日 ⁄ 综合 ⁄ 共 296字 ⁄ 字号 评论关闭

 http://www.weste.net/2005/12-21/11493397944.html

网上找的:挺优雅的 记下来

alert那块的id是参数名称

<script type="text/javascript">
Request = {
 QueryString : function(item){
  var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i"));
  return svalue ? svalue[1] : svalue;
 }
}
alert(Request.QueryString("id"));
</script>

 

抱歉!评论已关闭.