JS取URL参数值的一个方法

Code
function GetQueryValue(name)
{
var reg=new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r=window.location.search.substr(1).match(reg);
if (r!=null) return unescape(r[2]);
return "";
}
posted @ 2008-10-14 10:37  KenBlove  阅读(1219)  评论(0编辑  收藏  举报