对ajax的详细理解

来源:互联网 发布:淘宝白菜价在哪 编辑:程序博客网 时间:2024/05/17 20:29
$.ajax({        type: "POST",   //访问WebService使用Post方式请求        contentType: "application/json", //WebService 会返回Json类型        async: false,        //url: "../WebService.asmx/BrandDate", //调用WebService的地址和方法名称组合 ---- WsURL/方法名                url: "../WebService.asmx/BrandDateStr",        data: "{'ProductID':"+productid+",'BrandID':"+brandid+"}",         //这里是要传递的参数,格式为 data: "{paraName:paraValue}",下面将会看到               dataType:"json",        success: function(result) {     //回调函数,result,返回值             datastr= result.d;                     }    });
0 0
原创粉丝点击