Advertisement
Varun_Krishna

Alert.js

Mar 27th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var app = {
  2.     initialize: function(){
  3.         this.bindEvents ();
  4.     },
  5.     bindEvents: function() {
  6.         document.addEventListener("deviceready",this.onDeviceReady,false);
  7.     },
  8.     onDeviceReady: function(){
  9.         alert("This is my first phonegap application");    
  10.     },
  11.     submit: function() {
  12.         //$.mobile.changePage("inbox.html");
  13.         navigator.notification.alert("You have clicked the login button, now you will be redirected to a new page",app.alertDismiss,"Success Alert","Dismiss Me");
  14.         //$.mobile.changePage("inbox.html");
  15.         window.location = "inbox.html";
  16.     },
  17.     reset: function() {
  18.         navigator.notification.alert("Are you sure you want to crear all the fields ?", app.alertDismiss,"Reset Alert","Dismiss Alert");
  19.     },
  20.    
  21.     alertDismiss: function() {
  22.         alert("The alert is dismissed");
  23.     }
  24. };
  25.  
  26.  
  27. /* The error message is as follows
  28. The error message from firebug is
  29. TypeError: navigator.notification is undefined
  30. ...e clicked the login button, now you will be redirected to a new page",app.alertD... */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement