手机
当前位置:查字典教程网 >编程开发 >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实现web页面中级联菜单的设计

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

AJAX 二级级联菜单实现代码

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

AJAX 缓存问题的两种解决方法(IE)

ASP AJAX 静态分页第1/2页

好用的AJAX类代码分享

Ajax的使用代码解析

AJAX对服务器返回XML的处理方法

js ajax加载时的进度条代码

精品推荐
分类导航