【发布时间】:2012-01-27 01:03:54
【问题描述】:
我有一个通过 Jquery AJAX 调用从 XML 文件中获取内容的页面。
问题是它会在刷新时为除 IE 之外的每个浏览器更新 XML 文件中的内容。
我试图用元标记解决这个问题
<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.ini 中操作 http 标头。 jonasjohn.de/snippets/php/headers.htm
标签: jquery internet-explorer-8 refresh