关于window.location.reload(false);window.location.reload(true);history.Go(0)区别
来源:互联网 发布:实力vip软件下载 编辑:程序博客网 时间:2024/05/16 12:09
在日常工作中常用的页面刷新方式的区别:
window.location.reload(false);
先说说window.location.reload(false);当我们window.location.reload();默认也是false;
它先会根据浏览器的http请求的头部 If-Modified-Since的值来判断在请求文件时文件是否发生变化,如果没有就从缓存中找到更新到页面。
window.location.reload(true);
这个跟false的有区别,无论文档的修改时间是什么,或者有没有缓存,它都会从新在服务器端请求一次来更新到页面。
history.Go(0)
先说说history,history就是你访问的页面跟路由的记录,它会实时更新到history里面去,当你history.go(xx),会根据记录的路由匹配对应的以及缓存好的页面,也就是说所有的history都是调用已经被缓存的页面。
最后再说说浏览器的左上角返回箭头按钮
它的作用是返回上个页面,但是返回后页面的数据也就是并不会更新,文档也不更新。
注:window.location.reload(),window.location.reload(true),history.Go(0),都会更新数据,对于文档更新与否上面已经解释过了。
阅读全文
0 0
- 关于window.location.reload(false);window.location.reload(true);history.Go(0)区别
- window.location.reload;刷新
- window.location.reload;刷新
- window.dialogArguments.location.reload();
- window.location.reload
- window.location.reload()
- location.reload()和 location.false(true)的区别
- history.go()和location.Reload()和location.href 区别
- window.location.reload()与window.location.href区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- window.location.Reload()和window.location.href 区别
- Qt 5入门指南之Qt Quick编程示例
- SAP MM批次管理(4)批次分类
- hpuoj【1054】保留字母 [水题]
- CRC算法
- angularjs 首次加载页面 及页面切换的动画
- 关于window.location.reload(false);window.location.reload(true);history.Go(0)区别
- Http协议详解
- 二叉树知道前序和中序求后序,知道中序后序求中序
- 目标跟踪算法小结(二)
- js localStorage 和 sessionStorage
- 一次启停引发的故障
- 抽象类不能进行实例化吗?
- interrupt遇到wait抛异常InterruptedException
- mysql中文编码问题