Closed dman777 closed 6 years ago
How can I use page.js api's to set the pushState so that I can set the url query params without reloading the page?
The below works on initial page load with /search-listings but after that, I can not get the url to change with pushState:
/search-listings
page('/search-listings', function(context) { window.history.pushState(null, null, '/search-listings?foo=bar') console.log('aaaaa'); app.route = 'search-listings'; });
You do not need to call the pushState function because page.js already does this automatically.
pushState
@matthewp , this can be closed ;)
There's also page.replace which we should probably document...
Yep, thanks!
How can I use page.js api's to set the pushState so that I can set the url query params without reloading the page?
The below works on initial page load with
/search-listings
but after that, I can not get the url to change with pushState: