你怎麼可以閱讀下面的,不存在的applicationCache.add()
功能,你只能更新您的清單,所以緩存失效
reference
[Exposed=Window,SharedWorker]
interface ApplicationCache : EventTarget {
// update status
const unsigned short UNCACHED = 0;
const unsigned short IDLE = 1;
const unsigned short CHECKING = 2;
const unsigned short DOWNLOADING = 3;
const unsigned short UPDATEREADY = 4;
const unsigned short OBSOLETE = 5;
readonly attribute unsigned short status;
// updates
void update();
void abort();
void swapCache();
// events
attribute EventHandler onchecking;
attribute EventHandler onerror;
attribute EventHandler onnoupdate;
attribute EventHandler ondownloading;
attribute EventHandler onprogress;
attribute EventHandler onupdateready;
attribute EventHandler oncached;
attribute EventHandler onobsolete;
};
你可以使用',而不是localStorage'存儲文件內容,然後使用它們作爲資源從那裏使用數據URI。 – CBroe
您所聽到的'add()'方法根本不屬於HTML5脫機應用程序規範。它似乎是Firefox中Chrome引擎使用的[內部方法](https://developer.mozilla.org/en-US/docs/nsIDOMOfflineResourceList#add.28.29)。 – Epoc