Elena
Elena

Reputation: 649

window.location doesn't reload with params

I'm replacing window.location with params here :

 window.location.replace('/results/#'+ params);

but this won't reload the page with new params, Im also trying to reload the page after :

 window.location.pathname === '/results/' && window.location.reload();

but this will reload the page with old parms

Upvotes: 0

Views: 84

Answers (1)

Daniel A. White
Daniel A. White

Reputation: 190947

The # hash won't cause a page reload since it represents a fragment of the current page. You can listen to onhashchange and do something at that time.

Upvotes: 1

Related Questions