problem description
url: http://localhost:63343/IPcom/goodsDetail.html?booksId=1
alter r booksId=1,,1,
booksId=1
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
alert(r);
if (r != null) return unescape(r[2]);
return null; //
}
//URLbooksId
var id = getUrlParam("booksId");
console.log("id:"+id);