<meta http-equiv="expires" content="Thu, 01 Jan 1970 00:00:01 GMT" /> <meta http-equiv="expires" content="0" /> PHP: header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); ASP: Response.expires=0 Response.addHeader("pragma","no-cache") Response.addHeader("Cache-Control","no-cache, must-revalidate") JSP: response.addHeader("Cache-Control", "no-cache"); response.addHeader("Expires", "Thu, 01 Jan 1970 00:00:01 GMT");
在XMLHttpRequest发送请求之前加上: XMLHttpRequest.setRequestHeader("If-Modified-Since","0"); XMLHttpRequest.send(null);
IE下的reponseXML问题
使用responseXML时,IE下只能接受.xml为后缀的XML文件,如果不能以.xml文件为结尾的,则需要如下处理:
- 在服务器端声明是xml文件类型。如:
PHP:header("Content-Type:text/xml;charset=utf-8"); ASP:Response.ContentType = "text/xml"; JSP:response.setHeader("ContentType","text/xml");
- 利用responseText获取,然后封装成XML。
- 在AJAX应用上,JSON和JsonML是XML非常好的替代品。
上一篇:社区类网站:社区关系链存在的两种模式
下一篇:CSS技巧总结 段正淳的css笔记 Ⅰ
|