我有一个通过Jquery AJAX调用从XML文件抓取内容的页面。Internet Explorer在刷新时不会更新AJAX处理的内容?
问题是它将更新每个浏览器(除IE以外)刷新时XML文件的内容。
我试图与meta标签
<meta http-equiv="expires" content="-1"/>
<meta http-equiv="cache-control" content="no-cache,must-revalidate" />
<meta http-equiv="pragma" content="no-cache"/>
这是相关的JavaScript的一小部分
$(document).ready(function(){
$.ajax({type: "GET",url: "file1.xml",dataType: "xml", success: parseXml });
}
function parseXml(xml){
document.getElementById(eventMonthName).innerHTML=firstxmlvari.getElementsByTagName('month')[0].childNodes[0].nodeValue;
}
任何建议将非常赞赏解决这个!
我不知道是什么后端ŧ您使用的技术,但您应该尝试设置HTTP标头。根据我的经验,较旧的IE浏览器对元标签的反应并不好。这里是如何操作php中的http头。 http://www.jonasjohn.de/snippets/php/headers.htm – 2011-12-23 19:54:52