博客: https://lonhon.top/

http://a.a.com/data?id=1&time=2018-06-07'

此时通过 window.location.search 能够正常获取到url中的查询参数 id=1&time=2018-06-07

http://a.a.com/#/data?id=1&time=2018-06-07'

此时通过 window.location.search 获取到的参数为空"",这是因为使用了hash导致,因为hash会将url中第一个#后的内容都作为hash内容,所以search为空了.

解决办法: 通过处理location.hash来获取query.

相关文章:

  • 2021-05-14
  • 2022-12-23
  • 2023-03-06
  • 2022-12-23
  • 2021-06-30
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-06-18
  • 2022-12-23
  • 2021-07-29
相关资源
相似解决方案