JQuery ajax

Posted on 2017-04-12 11:46  熊先生丶  阅读(86)  评论(0编辑  收藏  举报

 

$.ajax({
                type: 'post',//提交方式
                url: '../Service/CIICService.asmx/addorupdate',//路径
                dataType: 'json',
                data: JSON.stringify(obj),//传入的参数
                beforeSend: function () {

                },//正在执行时调用的还是
                contentType: "application/json;charset=utf-8",//格式UTF-8
                success: function (data) {
                   
                },//执行完成,data为返回的结果
                error: function (x, e) {
                    //alert(e);
                },//异常时调用
                complete: function (x) {
                    //alert("complete:" + x.responseText);
                }//请求完成时运行,即使请求并未成功。



            })