-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
42 lines (40 loc) · 1.02 KB
/
test.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
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<script src="js/jquery-1.11.2.min.js"></script>
<script src="js/bootstrap-3.3.4.min.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
</head>
<body>
<div class="col-row">
<div class="col-xs-2">
<input id="appId" name="appId" type="text" class="form-control" autocomplete="off"/>
</div>
</div>
<script >
// 我们可以通过如下方式进行与后台进行交互
// data是对象列表,id是对象的一个属性
// $.ajax({
// cache : true,
// type : 'get',
// url : your url,
// dataType : 'JSON',
// async : true,
// success : function(data){
// if($('#appId')){
// $('#appId').typeahead({
// source: data,
// display: 'id'
// });
// }
// },
// error : function(jqXHR, textStatus, errorThrown){
// console.log(errorThrown);
// }
// });
</script>
</body>
</html>