ajax传参到服务端

前端

            $.ajax({
                cache : true,
                type : "POST",
                url : "ComCamera/command/",
                data :{"pan" : $("#up").val()},
                dataType : "json",
                async : false,
                success : function(msg) {
                    if (msg == "s"){
                        alert("success!");
                    }
                }
            });

服务端接参

@Post("/command")
    public String comCamera(int pan, int tilt){}

 

posted @ 2017-10-16 11:00  RealWorld♂  阅读(280)  评论(0)    收藏  举报