ServiceNow 页面中获取Url参数

function onLoad() {
var requestBy = getParameterValue("id");//id 为querystring的key
}

function getParameterValue(name) {
name = name.replace(/[[]/, "\[").replace(/[]]/, "\]");
var regexS = "[\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(unescape(top.location));
if (results == null) {
return "";
} else {
return unescape(results[1]);
}

posted @ 2019-05-07 14:48  hongsedigua  阅读(235)  评论(0编辑  收藏  举报