1

サンプルサイトがあります:

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

index.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

test.js:

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

インターネットに接続せずに localhost で初めてサイトを開くと、コンソールに「Fial」と表示されます。

アプリケーション キャッシュ マニフェストのフォールバック セクションでhttp://different_domainを使用できますか?

4

1 に答える 1

2

いいえ、仕様から

フォールバック名前空間とフォールバック エントリは、マニフェスト自体と同じ起源を持つ必要があります。

于 2012-04-01T18:00:59.030 に答える