Reputation: 75945
I have an offline 'redirector' script. Basically a page that has javascript window.location = 'xx' to redirect me to my correct location depending on cookies.
The problem is the manifest will not download and cache if the redirect is too soon (hence canceling the appcache download). So i've thrown in a delay there.
Obviously people have different internet connection speeds so is there a way to say when the manifest is loaded then execute this javascript (a callback or event) or something??
Upvotes: 0
Views: 686
Reputation: 91467
Use applicationCache.oncached
:
applicationCache.oncached = function (e) {
location.href = "xx";
};
Upvotes: 1