test.html
1.9 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
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>测试页面</title>
<style type="text/css">
ul{ padding: 0; margin: 0; list-style: none;}
ul li{ margin-top: 5px;}
b{ padding: 3px 10px; background-color: #f2f2f2; margin-left: 10px;}
</style>
<script src="jquery-2.1.4.min.js"></script>
<script>
$(function(){
$("#getvalue").click(function(){
var n=$.trim($("#methodname").val());
var c="{";
$(".csul li span").each(function(){
var c1='"'+$.trim($(this).find(".cs1").val())+'"';
var c2='"'+$.trim($(this).find(".cs2").val())+'"';
var c3=c1+":"+c2+",";
c+=c3
})
c= c.substring(0, c.length-1);
c+="}";
var data=$.parseJSON(c);
$.post(n,data,function(data) {
var result=JSON.stringify(data);
$("#result").html(result);
})
});
$(".addcs").unbind('click').click(function(){
var html='<li><span><input type="text" style="width: 150px;" class="cs1">:<input type="text" class="cs2" style="width: 100px;"></span><b>-</b></li>';
$(".csul").append(html);
$(".csul li b").unbind('click').click(function(){
$(this).parent().remove();
})
});
})
</script>
</head>
<body>
方法名:<input type="text" style="width: 600px;" id="methodname" value="http://localhost:8080/espeedYxyService/addr_findAddressByCondition.action"><br><br>
参数:<b class="addcs">+</b>
<br>
<ul class="csul">
</ul>
<br><br>
关键词: currpage pagesize condition conditionvalue mailid status loginid foldername ……
<br><br>
<input type="button" id="getvalue" value="提交"><br><br>
结果:<span id="result"></span>
</body>
</html>