js匹配url地址中参数 支持中文

  • Post author:
  • Post category:其他


	  function GetQueryString(name) //匹配参数 支持中文
	  {
	       var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
	       var r = decodeURIComponent(window.location.search).substr(1).match(reg);
	       if(r!=null)return  unescape(r[2]); return -1;
	  }