Reputation:
I want to reload a page like so :
window.location.href = url;
But given my url contains an anchor the previous instruction won't do anything. How to deal with this issue ? Thank you for the great help.
Upvotes: 0
Views: 108
Reputation:
You can do location.replace("https:/rickrolled.com");
So, to redirect, you can do location.replace(location.href);
Or just do location.reload();
If it doesn't work, please send me a JSFiddle of your project.
Upvotes: 1