Reputation: 55
all ready link here : site.com/en/#gone_videoid
new url :
var url = 'en/#gone_videoid2';
window.location.href= url;
coming url : site.com/en/#gone_videoid2
but window refeshing when refering location href i want work like this click
<a href="en/#gone_videoid2">video</a>
this clickig not refeshing window
Upvotes: 1
Views: 79
Reputation: 2625
use window.location.hash
instead of window.location.href
:
window.location.hash = "#gone_videoid2"
will only update the hashtag of the current URL
Upvotes: 1