1

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

4

2 回答 2

1

使用window.location.hash而不是window.location.href

window.location.hash = "#gone_videoid2"

只会更新当前 URL 的标签

于 2012-10-27T02:45:45.833 回答
0
location.href=newUrl

没有刷新窗口

于 2012-10-27T03:01:21.310 回答