JQuery: change URL parameter without reloading?

I have a question, is it possible to change the URL via jQuery under the following conditions:

  • The same url will load in browser and reboot
  • The page does not reload when changing a parameter
+7
source share
2 answers

If you want to prevent page reloading, you will have to use the hash "#"

And if you want to change the url, try the following:

jQuery.param.querystring(window.location.href, 'valueA=321&valueB=123'); 

This will return the following URL:

http://bla.com/test.html?valueA=321&valueB=123

+5
source

Maybe I'm wrong, but I think the browser will make a message if you change the location.

So, can this help you use the post instead of GET and change the hidden field / just set the value?

You can use jQuery.ajax () to make calls on the server by specifying the values ​​that you need in the message (or receive as you wish). This way the url does not change and you make the requests you need.

+3
source

All Articles