Ajax提交请求模板

 1  function methodName() {
 2             var params = {
 3 
 4             };
 5             var url = '';
 6             jQuery.ajax({
 7                 type: 'POST',
 8                 contentType: 'application/x-www-form-urlencoded',
 9                 url: url,
10                 data: params,
11                 dataType: 'json',
12                 success: function (data) {
13                    
14                     alert("成功啦");
15                 },
16                 error: function (data) {
17                     alert("失败啦");
18                 }
19             });
20         }

猜你喜欢

转载自www.cnblogs.com/dw3306/p/9178235.html