// 跳转页面、传递参数
let aa={
b:'测试',
c:'对的'
}
//跳转并携带对象参数
let encodedObject = encodeURIComponent(JSON.stringify(aa));
window.open(`/weboffice.html?data=` + encodedObject, '_blank');
// 接收页面:
let urlParams = new URLSearchParams(window.location.search);
let encodedObject = urlParams.get('data'); // 获取 param1 的值
var decodedObject = JSON.parse(decodeURIComponent(encodedObject));
console.log(decodedObject)
window.open携带对象传参并获取
最新推荐文章于 2024-07-24 10:40:52 发布