Skip to content

Instantly share code, notes, and snippets.

@alunny
Created April 18, 2012 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alunny/2416865 to your computer and use it in GitHub Desktop.
Save alunny/2416865 to your computer and use it in GitHub Desktop.
navigator.notification.confirm
<html>
<h1>Confirmation Test</h1>
<script src="phonegap.js"></script>
<script>
// process the confirmation dialog result
function onConfirm(button) {
alert('You selected button ' + button);
}
// Show a custom confirmation dialog
//
function showConfirm() {
navigator.notification.confirm( 'You are the winner!', // message
onConfirm, // callback to invoke with index of button pressed
'Game Over', // title
'Restart,Exit' // buttonLabels
);
}
document.addEventListener('deviceready', function (e) {
showConfirm();
}, false);
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment