test.html 1.9 KB
<!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>