ajax局部刷新可以通过html5的新特性修改browser address。
window.history表示window对象的历史记录
window.history.pushstate(object, title, new_url) -- 在window.history里新增一个历史记录点
window.history.replacestate(object, title, new_url) -- 在window.history替换当前page的历史记录点
object - 可以扩展想要的object
title - 目前所有浏览器都不支持
new_url 浏览器不会检查url是否存在,只改变url,url必须同域,不能跨域
eg: original url: www.test.com
window.history.pushstate({time: 'test'}, ' ', 'www.test_test.com')
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
-
-
-
-
-
-
H5笔记
H5笔记元素sectionnav元素section在html5中,article元素可以看成是特殊类的secti...
[阅读全文]
-
-
-
网友评论