I am using jQueryMobile and PhoneGap in my application. I want to display an Error page ("Network not available") when there is no mobile network. How can I display the error page without loading this page atleast once.
2 Answers
I also have this issue - I have resorted to have a 'page' which contains the error message, then I load the page up as a dialog (see docs for v1.3).
The dialog shows but there is only a default background behind the dialog.
- Or use phonegaps notification feature
notification.alert
Shows a custom alert or dialog box.
navigator.notification.alert(message, alertCallback, [title], [buttonName])
message: Dialog message (String) alertCallback: Callback to invoke when alert dialog is dismissed. (Function) title: Dialog title (String) (Optional, Default: "Alert") buttonName: Button name (String) (Optional, Default: "OK")
http://docs.phonegap.com/en/2.7.0/cordova_notification_notification.md.html#notification.alert

- 444
- 1
- 11
- 24
-
ok thanks GMan. It works, but it will show as "Pop up Blocked" in the browser. If I allow the popups for that application, then the error page opens up in a new window. Anyways Thank you so much for the idea :) – Sriks May 31 '13 at 16:45
-
phonegap also has a notification plugin which you can use - – GMan Jun 02 '13 at 13:45
Check this post. Check out how many other app handle that, very few are using a new page for that. There is also this realted post that might also be useful.

- 1,186
- 1
- 15
- 35
-
ok this is a good tutorial. But here in my application I want to navigate to an error page, this tutorial helps me to find out whether network is there or not. If not then it will throw alert, but we can't redirect to a page which is in server. Anyways thanks for the nice tutorial :) – Sriks May 31 '13 at 16:47