DEV Community


Posted on

Redirect with the same query

How to redirect user from the current page to another page with the same query string using javascript?

document.location = "" +
Enter fullscreen mode Exit fullscreen mode

All we need is the document.location object.
The query string is in property.
That’s all.

I hope you found this article useful, if you need any help please let me know in the comment section.

πŸ‘‹ See you next time. Have a nice day!

Subscribe to our channel:

Discussion (0)