2

The app in question is a magazine that behaves like many of the iPad magazine apps, but it is a web page. I have a spinner that runs for the duration of the initial query setup, with a healthy additional two seconds.

this works fine when starting the web app from a web page, but after saving to the home screen, where is is cached properly, it takes almost twice as long before it becomes responsive, yet the spinner lasts the usual time.

is there a way to tell if the app is opened from the home screen icon so I can add some extra 'pad time' to the spinner, keeping the user from jabbing at the screen and cursing may name in frustration, and possibly deleting the app?

A sample of the app in question can be seen here: http://straathof.acadnet.ca/stacks/test1/

try to time the spinner/response for movement from the web page and save it to the home screen and reopen it to see the delay in behaviour...

any help is always appreciated.

nosarious
  • 309
  • 1
  • 12

2 Answers2

1

This may work, as well as a timer to add more messages while people are waiting. detecting UIWebView with Javascript

The modified code to turn off the spinner is here, as derived from the link above. The spinner is constructed with spin.js...

this may need modification after ios5 as the delay due to slow javascript may be solved.

$(window).load(function(){
   if (window.navigator.standalone == true) {
   //not in safari
        var timer = 10000; // longer timer for homepage icon
   } else { 
        var timer = 2500; // shorter time for safari   
               }

    setTimeout ( function () {
          spinner.stop();
        $('#spinner').addClass('hidder').css('z-index','-10'); 
          updateOrientation;
    },timer);  
});
Community
  • 1
  • 1
nosarious
  • 309
  • 1
  • 12
0

You can append you url address a querystring ?is_cached=true on run time from JS, then once the user will add the app to the homescreen (or his favorites) it will be saved with the querystring :)

Michael
  • 1,058
  • 10
  • 17
  • but will this add padding to the spinner display if the page is cached within mobile safari (i.e.: not saved to the home screen) I've discovered that there is a difference in how javascript is run between mobile safari and the home-page icon (UIWebView). Currently UIWebView has no acceleration. I'll be looking into whether one can browser-sniff for this... – nosarious Sep 22 '11 at 15:06