Last active
August 31, 2015 17:18
-
-
Save zergiocosta/c51a0ed1323a2c008c45 to your computer and use it in GitHub Desktop.
Manipulating content into alert boxes
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
// simple alert box | |
navigator.notification.alert( | |
"Alert body text", | |
myFunction, // function to be called when alert is triggered | |
'My alert title', | |
"Button" | |
); | |
function myFunction(){ | |
console.log('working fine'); | |
} | |
//////////////////////////////////////// | |
// alertbox with options | |
navigator.notification.alert( | |
"Alert body text", | |
myFunction, // function to be called when alert is triggered | |
'My alert title', | |
["OK", "Back to app"] | |
); | |
function myFunction(b){ | |
if(b == 1){ | |
console.log("user said OK"); | |
} else { | |
console.log("user said Back to app"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment