Skip to content

Instantly share code, notes, and snippets.

@mhaylock
Forked from lrvick/notification.confirm.md
Created July 9, 2013 23:31
Show Gist options
  • Save mhaylock/5962240 to your computer and use it in GitHub Desktop.
Save mhaylock/5962240 to your computer and use it in GitHub Desktop.

foo

  1. index is the 0 based index value of the button pressed

  2. label is the text label of the button pressed

         function showConfirm() {
             var confirmDelegate = navigator.notification.confirm(
                 'You are the winner!',  // message
                 'Game Over',            // title
             'Restart,Exit'          // buttonLabels
             );
             confirmDelegate.onAlertDismissed = function(index,label) {
                 // confirm dismissed, take appropriate action
                 console.log('You selected button ' + index + ' with label ' + label);
             }
         };
    
  3. index is the 0 based index value of the button pressed

  4. label is the text label of the button pressed

         function showConfirm() {
             var confirmDelegate = navigator.notification.confirm(
                 'You are the winner!',  // message
                 'Game Over',            // title
             'Restart,Exit'          // buttonLabels
             );
             confirmDelegate.onAlertDismissed = function(index,label) {
                 // confirm dismissed, take appropriate action
                 console.log('You selected button ' + index + ' with label ' + label);
             }
         };
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment