这里我定义两个html页面,分别是1.html与2.html(以下简称1和2),1是需要传递数据的,2是接收数据的。1中"?"前面的需要跳转的url地址,后面的就是需要携带的数据。

1.html

location.href = "2.html?id=1";

 

2.html 

window.location.search ——设置或返回从问号 (?) 开始的 URL(查询部分)。

相关文章:

  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2021-06-01
  • 2022-02-18
猜你喜欢
  • 2022-01-16
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案