function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return (r[2]); return null; }
使用
页面当前地址 http://localhost:9489/AppMWeb/Submodule/CU/AddFamilyMember.aspx?CustomerID=23384438&Role=1; var s = GetQueryString(CustomerID); console.log(23384438);