-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
48 lines (47 loc) · 1.37 KB
/
index.html
File metadata and controls
48 lines (47 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>Probe</title>
<style>
body{
background: #8b9dc3;
}
div#main{
background: dfe3ee;
width: 80%;
height: 82%;
padding: 10%;
-webkit-border-radius: 8px;
}
</style>
</head>
<body>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript">
function alertCompliment(){
var elementId = this.id;
var greeting;
if(elementId == "likeMe")
{greeting = "you are";}
else if(elementId == "likeHer")
{greeting = "she is";}
navigator.notification.alert("We really do think that " + greeting + " the best.", function(){}, greeting + " the best");
}
DOMContentLoaded:
document.addEventListener("deviceready", function()
{
document.getElementById("likeMe").
addEventListener("click", alertCompliment, false);
document.getElementById("likeHer").
addEventListener("click", alertCompliment, false);
}, false);
</script>
<div id="main">
You are really great!<br>
<button id="likeMe" onclick="alertCompliment(); return false">Tell me I'm great</button><br>
<button id="likeHer" onclick="alertCompliment(); return false">Tell her she is great</button><br>
</div>
</body>
</html>