Simple question: Can I write GET parameters to the current document URL with JavaScript?
Say my URL is:
/search
Can I change it to:
/search?price_from=100
Without posting back the page?
I’m creating a single-page JavaScript application and the History API. I would like to let people search without reloading the page. I’d also like to let them link to results page URLs that use standard GET parameters.
Just use
history.pushState:The History API isn’t supported by older browsers though, if you need to support them you could use Mark’s suggestion.