-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03_rand.html
More file actions
42 lines (32 loc) · 754 Bytes
/
03_rand.html
File metadata and controls
42 lines (32 loc) · 754 Bytes
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/ajax.js"></script>
<script>
onload = function(){
var ul = document.getElementById("list");
ajax({
url: "http://60.205.181.47/myPHPCode4/getRank.php",
data:{},
success: function(data){
console.log(data);
var arr = JSON.parse(data);
for (var i=0; i<arr.length; i++) {
var obj = arr[i];
var li = document.createElement("li");
ul.appendChild(li);
li.innerHTML = i+1 + ". [" + obj.name + "] : " + obj.score;
}
}
})
}
</script>
</head>
<body>
<h1> 飞机大战排行榜 </h1>
<ul id="list">
</ul>
</body>
</html>