本文介绍了javascript更改get参数而不重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不重定向的情况下更改get参数?
How can I just change the get parameter without redirecting?
parent.location.search = "?after=20"; // ok that changes, but also redirect to the new page任何解决方案?或者答案是否定的,如果不是,请写下大号。
Any solution? Or answer is no, if its no, please write big no.
推荐答案更新
由于这是接受的答案,并且不再是真的,请参阅此重复的问题获取最新信息。
Update
Since this is the accepted answer, and no longer true, refer to this duplicate question for up to date information.
原始答案如下:
您可以接近URL的锚点部分,可以通过哈希访问位置的属性对象
You can come close with the anchor portion of the URL which is accessible by the hash property of the location object
parent.location.hash = "whatever value you want";更多推荐
javascript更改get参数而不重定向
发布评论