手机
当前位置:查字典教程网 >编程开发 >AJAX相关 >AJAX防止页面缓存的代码
AJAX防止页面缓存的代码
摘要:采用AJAX技术的时候通常我们无刷新页面提交数据后用同样的url去获取数据的时候会发现是以前的数据~那样就给client端带来假象了~~采用...

采用AJAX技术的时候通常我们无刷新页面提交数据后用同样的url去获取数据的时候会发现是以前的数据~那样就给client端带来假象了~~采用以下的方法可以取消缓存

htm网页

<metahttp-equiv="pragma"content="no-cache">

<metahttp-equiv="cache-control"content="no-cache,must-revalidate">

<metahttp-equiv="expires"content="wed,26feb199708:21:57gmt">

或者<metahttp-equiv="expires"content="0">

asp网页

response.expires=-1

response.expiresabsolute=now()-1

response.cachecontrol="no-cache"

php网页

header("expires:mon,26jul199705:00:00gmt");

header("cache-control:no-cache,must-revalidate");

header("pragma:no-cache");

jsp网页

response.addHeader("pragma","no-cache");

response.addHeader("cache-control","no-cache,must-revalidate");

response.addHeader("expires","0");

【AJAX防止页面缓存的代码】相关文章:

防止重复发送Ajax请求的解决方案

asp.net+Ajax 文本文件静态分页实现代码

AJAX实现web页面中级联菜单的设计

[js]一个获取页面ip的正则

AJAX请求类

Ajax初试之读取数据篇实现代码

非常简单的Ajax请求实例附源码

往xml中更新节点的实例代码

Ajax读取数据到表格的实现代码

Ajax的使用代码解析

精品推荐
分类导航