不让浏览器缓存js
来源:互联网 发布:php实现注册登录 编辑:程序博客网 时间:2024/05/01 19:41
方法一:
在html头部增加如下代码
<meta http-equiv="expires" content="0"><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache">
这样,修改了代码,页面浏览器就不会缓存了。不过IE浏览器直接刷新页面是没效果的,得把IE关了再打开就行了。(IE果然很流氓啊)
方法二:
在引用js文件的时候,添加随机数,代码如下
<script> document.write("<script type='text/javascript' src='/js/test.js?"+Math.random();+"'></script>"); </script>
PS:由于公司申请了两个域名。但是公司只有一个服务器,所以在index.html页面, 我做了js跳转。但是有一个域名是中文的,不同浏览器对中文域名解析是不一样的
例如:指约.com
IE和火狐:document.domain的值为:指约.com
谷歌:document.domain的值为:xn--xuuu82d.com
PS:js获取url信息
1、window.location.host;//包括访问端口--www.cube-window.com:888
2、document.domain;//不包含访问端口--www.cube-window.com
0 0
- 不让浏览器缓存js
- .net 不让浏览器缓存
- js中不让浏览器后退
- html页面调试设置不让浏览器缓存
- 设置html页面不让浏览器缓存的方法
- 设置html页面不让浏览器缓存的方法
- 设置html页面不让浏览器缓存的方法
- 浏览器js缓存
- js 清浏览器缓存
- 如何清除浏览器的缓存以达到不让别人从缓存中偷取网页资料?
- 浏览器JS文件缓存问题
- js 清除浏览器缓存方法
- ASP.net里不让浏览器缓存代码和Session使用注意事项
- js清除浏览器缓存的js
- 不让JSP缓存IE文件
- 防止浏览器缓存css,js静态文件
- js history.go 使用浏览器缓存
- 防止浏览器缓存css,js静态文件
- html DOM操作表格及样式
- 对char **argv的理解(多级指针)
- MySQL数据库update更新子查询[Err] 1093 - You can't specify target table 'text' for update in FROM clause
- Oracle统计信息
- Mongodb-1
- 不让浏览器缓存js
- iOS 绘制虚线
- HTML DOM Table 对象
- sql中exists,not exists的用法
- GDB调试php扩展错误(Segmentation fault (core dumped))
- Swift快速入门(一)基本类型
- our build settings specify a provisioning profile with the UUID “a1457f8e-1f2f-4f7c-8de1-f3540145b3c
- shell 正则表达式
- Android Studio 那些事| ' ' cannot be applied to '(groovy.lang.Closure)'