1

我有示例站点:

/index.html
/appcache.manifest
/style.css
/test.js

索引.html:

<!DOCTYPE HTML>
<html manifest="appcache.manifest">
<head>
    <link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
    <div id="map"></div>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script>window.google && window.google.maps || console.info('Fail');</script>
</body>
</html>

appcache.manifest:

CACHE MANIFEST

NETWORK:
*

CACHE:
index.html
style.css
test.js

FALLBACK:
http://maps.googleapis.com/maps/api/js?sensor=false test.js

测试.js:

window.google = window.google || {};
google.maps = google.maps || {};
console.info('I am work!!!')

当我第一次在没有互联网连接的本地主机上打开站点时,我在控制台中看到“Fial”。

我可以在应用程序缓存清单后备部分中使用http://different_domain吗?如果我能做错什么?

4

1 回答 1

2

不,从规范

后备命名空间和后备条目必须与清单本身具有相同的来源。

于 2012-04-01T18:00:59.030 回答