Skip to content

Instantly share code, notes, and snippets.

@mwbrooks
Created October 22, 2010 16:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mwbrooks/640933 to your computer and use it in GitHub Desktop.
Save mwbrooks/640933 to your computer and use it in GitHub Desktop.
Markdown code block within list item

iPhone Quirks

  • iPhone does not block while the confirm dialog is displayed.
  • Returns a delegate object from navigator.notification.confirm()
  • Calls delegate.onAlertDismissed(index, label) when confirm is dismissed
    • index is the 0 based index value of the button pressed

    • 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