Last active
August 29, 2015 14:21
-
-
Save franfj/b98517ebbcfaf8c89ecf to your computer and use it in GitHub Desktop.
Apache Cordova - Ejemplo API Notificaciones
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ejemplo API Notifi</title> | |
<script type="text/javascript" charset="utf-8" src="cordova.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
// Espera a que Cordova haya cargado. | |
document.addEventListener("deviceready", onDeviceReady, false); | |
function onDeviceReady() { | |
//Nada implementado | |
} | |
function alertDismissed() { | |
//Nada implementado | |
} | |
function mostrarMensaje() { | |
navigator.notification.alert( | |
'Hola Mundo!', // Mensaje | |
alertDismissed, // Callback | |
'Esto es un ejemplo', // Título del mensaje | |
'Ok' // Nombre del botón | |
); | |
} | |
</script> | |
</head> | |
<body> | |
<button onclick="mostrarMensaje(); return false;">Mostrar mensaje</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment