第一个页面需要传递的
window.location.href="search-one.html?"+val//跳转到自己需要的文件
在第2个页面接收
// 接取参数
let num = window.location.search.slice(1);
let arr = decodeURI(num)//使用decode将传递过来的参数进行拆解
console.log(arr);
这篇博客介绍了如何在第一个页面通过`window.location.href`传递参数到`search-one.html`,然后在第二个页面使用`window.location.search`和`decodeURI`解析并获取这些参数。这种方法在前端开发中常用于实现页面间的数据通信。
第一个页面需要传递的
window.location.href="search-one.html?"+val//跳转到自己需要的文件
在第2个页面接收
// 接取参数
let num = window.location.search.slice(1);
let arr = decodeURI(num)//使用decode将传递过来的参数进行拆解
console.log(arr);
2094

被折叠的 条评论
为什么被折叠?