Reputation: 5716
I have a page with URL like:
www.mydomain.com/orders.html?orderNumber=363035001&return=true
I need a way to reload the page via jQuery at a specific event, changing last parameter. So url to be reload should be:
www.mydomain.com/orders.html?orderNumber=363035001&return=false
Upvotes: 2
Views: 6961
Reputation: 5734
Using this you first get the URL form the current page, then change from true to false or viceversa, and then change the location.
URL = document.URL;
if(URL.indexOf('return=true') != -1)
URL = URL.replace('return=true','return=false');
else
URL = URL.replace('return=false','return=true');
window.location = URL;
Upvotes: 3
Reputation: 554
window.location.href="www.mydomain.com/orders.html?orderNumber=363035001&return=false"
Upvotes: 0
Reputation: 12329
You need to set your window.location
var to the url you want.
window.location = "www.mydomain.com/orders.html?orderNumber=363035001&return=false"
Here is a simple example
Upvotes: 0