开发者

change url address using Javascript [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to rewrite URL without refresh, like GitHub.com

let say I have variable in Javascript

var currentpage = 0;
开发者_Python百科

my address page address is www.xyz.com/page/1

when I click somewhere and js function trigger

currentpage = 1
//Here I want to change/rewrite www.xyz.com/page/2
//Without redirecting to this page


See pushState (browser support currently limited).


You can't. You have to use the '#' or '#!' notation and pass the page number after it, then do trigger some js on load to figure out which page to display.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜