-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
40 lines (31 loc) · 1.16 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>CordovaApiDemo</title>
<!-- CordovaApiDemo references -->
<link href="css/index.css" rel="stylesheet" />
<script src="cordova.js"></script>
<script src="scripts/index.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.min.js"></script>
<script>
function onDeviceReady() {
alert("启动结束")
$("#btn").click(function () {
$.getJSON('http://localhost:8080/learn/rest/first?jsoncallback=?').done(function (data) {
alert("second " + data.BNO + " " + data.address.country + " " + data.name);
}).fail(function (jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
alert("Request Failed: " + err);
});
})
}
</script>
</head>
<body>
<p>Hello, your application is ready!</p>
<a href="apidemo.html">apidemo</a>
<button class="btn btn-default navbar-btn btn-sm" id="btn">测试</button>
<!-- Cordova reference, this is added to your app when it's built. -->
</body>
</html>