Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
Hi,

after finally having purchased 4 licenses I struggle with making the appcache more transparent for our demo webapp. The idea is to give the user a message once the app is fully cached so he can be sure that it's now working offline.

I took an example from my JavaScript book that runs just fine in the local browser. It has event listeners for the different status values along these lines:

window.applicationCache.oncached = function() {
status("This application is now cached locally");
window.alert('This application is now cached locally');
return false;
};

I add this in the resources js section and don't append it to the export. Both the status messages (in the js console) and the alert message work in Firefox but nothing happens in Safari mobile even though according to Apple window.alert is supported.

Has anyone got an idea why this isn't executed?
I actually also looked into integrating "nicer" dialog windows such as
http://fabien-d.github.io/alertify.js/
Just had trouble integrating the html calls into the app. Any good first hints?

Would be terrific if we could solve this - I'd be willing to share any solution I come of with of course.

Cheers,

Mike
in how_to by (230 points)
  
Already found part of the answer myself: all of the events don't seem to be triggered when testing html output in safari mobile (due to the 10MB page being above browser cache size limit?)
But it does in fact run in the web-app. So I get a crude "cached" message.
Still, it would be nice to know how to trigger alertify/jquery-ui dialogs instead.

1 Answer

0 votes
 
Best answer

Hi Mike,

There isn't one way to do this, but here's a suggestion for a "nicer" alert.

Using the resources section, attach some custom HTML with the message inside that is hidden by default, then make it visible using jQuery (i.e. $('#customAlert').show()).

You can also attach CSS to style your custom alert box.

by (197k points)
selected by