var id=“123456789”;
window.location.href=“路径?id=”+id;
在跳转到的页面中获取参数:
//获取url中"?“符后的字串 ?id=“123456789”
var url = location.search;
var id,str,strs;
if(url.indexOf(”?") != -1) {
str = url.substr(1);
strs = str.split("=");
id = strs[1];
}
获取location.href跳转路径的参数
最新推荐文章于 2023-11-22 09:50:52 发布