js 获取当前url参数
2014-7-1 应用在某内网应用排序管理页面跳转:
function goSortManage() {
var name = ‘TypeID‘;
var TypeID = "0";
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
if (theRequest != null && theRequest[‘TypeID‘] != undefined) {
TypeID = theRequest[‘TypeID‘];
}
var url = ‘/tabid/294/Default.aspx?f_ID=‘ + TypeID + "&columns=7";
window.location.href = url;
}
注意:
1: theRequest[‘TypeID‘] != undefined 而不是 theRequest[‘TypeID‘] != "undefined"
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。