每當頁面緩存在Firefox和Webkit中時,它都會失去所有ajax功能。緩存頁面AJAX不工作
<html manifest=cache.manifest>
<head>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jqtouch.js" type="text/javascript"></script>
它只會檢索已被緩存的頁面,不管是什麼。有人知道怎麼修這個東西嗎? 在此先感謝! 編輯:Ajax代碼:
var http = false;
if(navigator.appName == "Microsoft Internet Explorer") {
http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
http = new XMLHttpRequest();
}
http.open("GET", "default.css", true);
http.setRequestHeader('CacheControl', "no-cache");
http.onreadystatechange=function() {
if(http.readyState == 4) {
alert('4(good):'+http.responseText);
}
}
http.send(null);
而且使用jQuery $就的請求。既沒有工作。 JQuery的:
$.ajax({
url: site_url,
cache: false,
dataType: 'html',
data: ({uuid : devid}),
success: function(response){
他們總是說成功,但只有當頁面緩存返回數據。否則它們返回null「」。
最後一件事:我請求的頁面不在清單上,因爲一個相當大的服務器端後端。不可能在清單中包含所有頁面。
基本上,我將如何訪問不在同一站點AJAX清單上的頁面。每當我嘗試目前它總是返回null。 return 03:11:41,即使沒有緩存等。
我不這麼認爲,只有服務器到服務器的調用不會第二次,客戶端到服務器的調用應該工作。你是否在做頁面級緩存 – kobe 2010-11-24 02:45:10
你可以給我們更多的細節,比如你的ajax代碼調用後端。 – kobe 2010-11-24 02:48:44
歡迎來到stackoverflow – 2010-11-24 02:52:16