-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchhtml.txt
71 lines (48 loc) · 1.58 KB
/
searchhtml.txt
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
{% load static from staticfiles %}
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="/static/myApp/js/jquery-3.3.1.min.js"></script>>
<link rel="stylesheet" href="/static/myApp/css/in.css" type="text/css" />
</head>
<body>
<h1>查询异常类信息</h1>
<div id="concent" align="center">
<font size="+2" color="#6633CC">请输入异常类名称:</font>
<input type="text" id="a" name="a">
<button id="btn">search</button></div>
<div id="abc">
</div>
<script type="text/javascript" >
$(document).ready(function () {
document.getElementById("btn").onclick=
function() {
var a=$("#a").val();
$.ajax({
type:"GET",
url:"/searchexc/",
data:{"a":a},
dataType:"json",
success:function (data,status) {
console.log(data)
var d=data["data"]
for(var i=0;i<d.length;i++)
{
$("#abc").empty()
var $p=$("<p>"+"具体描述: "+d[i][0]+"</p>")
var $r=$("<p>"+"示例: "+d[i][1]+"</p>")
$("#abc").append($p)
$("#abc").append($r)
}
},
error:function () {
alert("查询失败");
}
})
}
})
</script>
</body>
</html>