【发布时间】:2011-07-08 13:51:20
【问题描述】:
我在 Chrome 和 MobileSafari 上遇到了一个奇怪的问题(在 IE9 上效果很好)
我有以下代码: 变种产品;
function init()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","ipad/products.php",false);
xmlhttp.send();
products = JSON.parse(xmlhttp.responseText);
//alert(products.products[0].title);
getProduct(1);
}
init被body onload函数调用。
另外,我使用manifest缓存了一些文件:
<HTML manifest="manifest.php">
现在,当我第一次访问该页面时 - 一切正常。 刷新后 xmlhttp.send() 抛出“NETWORK_ERR: XMLHttpRequest Exception 101”
为了再次正常查看页面,我需要清理浏览器缓存
删除清单文件可以解决问题,但我需要它来离线浏览。
有人知道怎么回事吗?
谢谢
【问题讨论】:
标签: ajax caching google-chrome safari manifest