我們遇到了一個奇怪的問題,我們不確定究竟是什麼原因導致問題。讓我詳細說明這個問題。假設,我們有兩個不同的html頁面a.html和b.html。並寫入index.html的一個小腳本:刷新iFrame(緩存問題)
<html>
<head>
<script>
function reloadFrame(iframe, src) {
iframe.src = src;
}
</script>
</head>
<body>
<form>
<iframe id="myFrame"></iframe>
<input type="button" value="Load a.html" onclick="reloadFrame(document.getElementById('myFrame'), 'a.html')">
<input type="button" value="Load b.html" onclick="reloadFrame(document.getElementById('myFrame'), 'b.html')">
</form>
</body>
</html>
服務器組件不斷更新這兩個文件a.html和b.html。問題是兩個文件的內容都在服務器端成功更新。如果我們打開,我們可以看到更新的更改,但客戶端獲取的舊內容不顯示更新的更改。
有什麼想法?
@Ben - 有什麼建議XHTML在這個問題上被使用。例如,輸入也沒有結束標籤。 – Fenton 2012-01-27 15:51:10
此解決方案不適合我,請檢查[此問題](http://stackoverflow.com/questions/22451674/wrong-content-when-refresh-a-page-contains-iframes-in-ie) – dencey 2014-03-18 02:58:12