<!DOCTYPE html>
<html>
<head>
<meta charset=
"UTF-8"
>
<title>Notifications</title>
<script type=
"text/javascript"
charset=
"UTF-8"
src=
"cordova.js"
></script>
<script type=
"text/javascript"
charset=
"UTF-8"
>
document.addEventListener(
"deviceready"
, onDeviceReady, false);
function
onDeviceReady() {
checkConnection();
}
function
showAlert(){
navigator.notification.alert(
'Game Over!'
,alertCallback,
'Game Over!'
,
'Done'
);
}
function
alertCallback(){
}
function
showConfirm(){
navigator.notification.confirm(
'Game Over!'
,onConfirm,
'Game Over!'
,
'Restart,Exit'
);
}
function
onConfirm(button){
alert(
'You selected button '
+button);
}
function
playBeep(){
navigator.notification.beep(2);
}
function
vibrate(){
navigator.notification.vibrate(4000);
}
</script>
</head>
<body onload=
"onLoad()"
>
<p><a href=
"#"
onclick=
"showAlert(); return false;"
>Show Alert</a></p>
<p><a href=
"#"
onclick=
"showConfirm(); return false;"
>Show Confirmation</a></p>
<p><a href=
"#"
onclick=
"playBeep() return false;"
>Play Beep</a></p>
<p><a href=
"#"
onclick=
"vibrate() return false;"
>Vibrate</a></p>
</body>
</html>