var url = 'http://dancewithnet.com/';
url += '?temp=' + new Date().getTime();
url += '?temp=' + Math.random();
2 在HTTP headers禁止缓存。如:
HTTP:
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<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");
IE下的reponseXML问题
使用responseXML时,IE下只能接受.xml为后缀的XML文件,如果不能以.xml文件为结尾的,则需要如下处理:
1 在服务器端声明是xml文件类型。如:
PHP:header("Content-Type:text/xml;charset=utf-8");
ASP:Response.ContentType = "text/xml";
JSP:response.setHeader("ContentType","text/xml");
2 利用responseText获取,然后封装成XML。
3 在AJAX应用上,JSON和JsonML是XML非常好的替代品。









