由于window.history.pushState不aviliable对HTML 4级的浏览器IE9一样,我已经看过了history.js,模拟的pushState的行为jQuery库。
问题是,使用pushState的时候,该网址的结尾被复制
例如,
History.pushState(null,null,window.location.pathname + '?page=1');
回报,
http://www.development.com/test.html#test.html?page=1
如何避免这个问题? 非常感谢你。
更新(2012年/ 1/22),质疑赏金:
if (pageNo == 1){
//window.history.pushState({"html":currURL,"pageTitle":''},"", window.location.pathname + '?page=1'); For chrome and FX only
//History.replaceState(null,null,'')
//History.pushState(null,null,'?issue=' + currPageIssueNo + '&page=1');
}
else if (pageNo != 1 || pageNo == 1 && linkPageNo > 1 ) {
History.pushState(null,null,'?issue=' + currPageIssueNo + '&page=' + pageNo);
//window.history.pushState({"html":currURL,"pageTitle":''},"", newURL); For chrome and FX only
}
我仍然遇到问题,如果是第一页
http://localhost/development/flipV5.html?issue=20121220&page=1
当我去到第二页在IE9,它的网址:
http://localhost/development/flipV5.html?issue=20121220&page=1#flipV5.html?issue=20121220&page=2
我想实现的是
http://localhost/development/flipV5.html?issue=20121220&page=2
如果它的HTML浏览器4是不可能的,请至少实现
http://localhost/development/flipV5.html/#?issue=20121220&page=2
感谢好心帮