获取url上传递的参数
function getUrlParam(paraName) {
var url = document.location.toString();
//alert(url);
var arrObj = url.split("?");//id=3 name=jack
if (arrObj.length > 1) {
var arrPara = arrObj[1].split("&");//数组
var arr;
for (var i = 0; i < arrPara.length; i++) {
arr = arrPara[i].split("=");
if (arr != null && arr[0] == paraName) {
return arr[1];
}
}
return "";
}
else {
return "";
}
}
var itemID = getUrlParam("itemID");//url参数获取
var urllist = _spPageContextInfo.webServerRelativeUrl + "/_api/web/lists/getbytitle('" + par + "')/items?$select=*&$filter=ID eq " + itemID;