js中怎么获取url中的参数完整字符串(参数带有#)
比如name: 123#参数
通过 window.location.search只能获取到123,后面的#参数就获取不到了, 如何才能获取完整值(123#参数)
js中怎么获取url中的参数完整字符串(参数带有#)
比如name: 123#参数
通过 window.location.search只能获取到123,后面的#参数就获取不到了, 如何才能获取完整值(123#参数)
location.search+location.hash
location.search为查询参数,就是问号后那一串(不包含#后面的)
location.hash为#后面的参数
帮助到你能点个采纳吗,谢谢~