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]);
}

原文地址:https://www.cnblogs.com/hongsedigua/p/10825411.html