Created
April 18, 2012 21:51
-
-
Save alunny/2416865 to your computer and use it in GitHub Desktop.
navigator.notification.confirm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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