I'm developing web apps using jQuery Mobile. These apps use a database to get prices, etc (using php). I'm also using appcache to be able to use the apps offline.
<html manifest="manifest.appcache">
This is all working perfectly. But when I'm online, I don't want the apps to use the appcache. How do I do that?
I can check wether I'm online/offline by checking if a file is available:
$.ajax({
url:'http://someurl.com/online.txt',
type:'HEAD',
error: function()
{
console.log('offline');
},
success: function()
{
console.log('online');
}
});
However I can't find anything to have the page not use the appcache..
Am I missing something?
Step by step solution:
After i finally got it working i noticed it didn't work in Firefox because of the swapCache() function. (https://bugzilla.mozilla.org/show_bug.cgi?id=769171) Lucky me my users don't use Firefox..