2009年7月20日 星期一

Google Gears API Sample 簡單的離線網站

這個範例是修改自 Gears Tutorial 並po 到google app engine 作實際的測試, 如何上傳見 eclipse 上傳 google app engine



以下是步驟

1. 安裝 Gears


2. 將下載的檔案放入要上傳的位置,如 ../war


3. go_offline.html ,確認 .js file 的位置


4. 修改 tutorial_manifest.json, 這裡的內容(entries)決定 gears 會紀錄的檔案, url 後面是相對入路徑


"entries": [ { "url": "gears_init.js"}, { "url": "go_offline.html"}, { "url": "go_offline.js"} ]



驗證步驟
   1. 將上述步驟設定好得程式放上網路上, 我是傳到google app engine , http://2.latest.catontest2.appspot.com/
2. 先進入 該網站 點選 "cacture"

3. 接者設定 將 瀏覽器設為 離線瀏覽
FireFox: 檔案 -> 離線模式
IE: 檔案 -> 離線工作
4. 清除 網頁Catch , 以釐清是否事由Gears 讀取:
FireFox: 工具-> 清除隱私資料-> 快取打勾後按下 "立即清除隱私資料"
IE: 工具-> 網際網路選項->Temporary Internet files -> 刪除檔案

5. 在離線瀏覽下進入 網頁 , 若 gears 設定 有成功即可瀏覽, 否則會有一般無法連線的錯誤訊息
http://2.latest.catontest2.appspot.com/
無法進入,可以改由這個網址進入   

http://2.latest.catontest2.appspot.com/go_offline.html

沒有留言: