h5 history

简介: h5 history

history的Api方法和使用:


 history.pushState(data,title,url):在浏览器中新增一条历史记录;


 data会在onpopstate事件触发时作为参数传递过去,title为页面标题,url为页面地址;

    history.replaceState(data,title,url):在浏览器中替换当前历史记录;  


 data会在onpopstate事件触发时作为参数传递过去,title为页面标题,url为页面地址;   history.length():当前历史列表中的历史记录条数;

       window.onpopstate:实际上popstate是一个浏览器内置的点击事件,响应pushState和replaceState的触发调用;


 history.back(-1):返回到当前页的上一页(原页面表单中的内容会保留)


    history.back(0):页面刷新


       history.back(1):当前页前进一页


       history.go(-1): 返回到当前页的上一页(原页面表单中的内容会丢失,效果基本和history.back(-1)一样)


       history.forward():当前页面前进一页(和history.back(1)效果一样)


push&replace的区别?

push: 压栈的操作,每做一步都会留下痕迹


replace  替换


CACHE MANIFEST

分三个部分

路径设置 所有文件相对于当前appcache文件访问

CACHE 设置 要缓存的文件

NETWORK 要连网的文件

FALLLBACK 出错时的处理

相关文章
|
Web App开发 安全 Go
|
4月前
|
移动开发 前端开发 JavaScript
history.pushstate用法详解
history.pushstate用法详解
|
缓存 Go
history.go()和history.back(),history.go()不刷新
history.go()和history.back(),history.go()不刷新
|
Web App开发 安全 JavaScript
hash与history
hash与history
|
JavaScript 前端开发
History、Location
History 对象是 JavaScript 对历史记录进行封装的对象。History 对象的获取使用 window.history获取,其中window. 可以省略History 对象的函数。
75 0
History、Location
|
存储 Linux 应用服务中间件
history的操作你知道几个
history的操作你知道几个
145 0
history的操作你知道几个
|
移动开发 JavaScript 前端开发
History对象
History对象
140 0
|
Shell
History displays the time information
For those of you who use terminals a lot, one of the most common commands is probably history, which allows you to view the history of terminal commands executed
115 0
|
Shell
history命令解析_学习笔记
时间:2017.11.13 作者:李强 参考:man,info,magedu讲义 声明:以下英文纯属个人翻译,英文B级,欢迎纠正,盗版不纠,才能有限,希望不误人子弟为好。 1、使用目的与场景     实现快速操作命令的一种方式 2、官方说明     Display or manipulate the history list. 3、写在前面     首先这里有两个概念history list和history file。
934 0