你怎么可以阅读下面的,不存在的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