<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Cordova_Metro</title> | |
<!-- Cordova_Metro references --> | |
<link href="/css/default.css" rel="stylesheet" /> | |
<script src="/cordova.js"></script> | |
</head> | |
<body> | |
<button id="btnAlert" onclick="alertFunc()">Alert</button> | |
<button id="btnConfirm" onclick="confirm()">Confirm</button> | |
<br /> | |
<p>Title: <input id="inTitle" value="Hiya"/></p> | |
<p>Button: <input id="inButtonName" value="Yes,No"/></p> | |
<p>Message: <input id="inMessage" value="Hit me!"/></p> | |
<p id="status"></p> | |
<script type="text/javascript"> | |
function id (elementId) { | |
return document.getElementById(elementId); | |
}; | |
function status (message) { | |
id('status').innerHTML = message; | |
}; | |
function alertFunc() { | |
navigator.notification.alert(id('inMessage').value, function () { | |
status('Alert hit!'); | |
}, id('inTitle').value, id('inButtonName').value); | |
navigator.notification | |
}; | |
function confirm() { | |
navigator.notification.confirm(id('inMessage').value, function (i) { | |
status('Confirm hit button '+i+'!'); | |
}, id('inTitle').value, id('inButtonName').value); | |
}; | |
</script> | |
</body> | |
</html> | |