Tip for anyone building HTML 5 apps using PhoneGap (now called Cordova). If you are seeing inconsistent/transient error messages saying something like [Connection to server was unsuccessful to “www/assets/index.html”] when starting up your app. This is caused by your App timing out. You can either increase the time-out time, but will only reduce the frequency of the issue, or you can:
- Rename your index.html to “main.html”
- Create a new “index.html” and put the following content into it:
<!doctype html> <html> <head> <title>tittle</title> <script> window.location='./main.html'; </script> <body> </body> </html>
- Rebuild your app! No more errors!
Another good idea is to give your application a “splash screen”, so that the user gets instant feedback that your app is loading/working, before it is fully ready.