Ajax提交请求模板

Posted 邓维

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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         }

 

以上是关于Ajax提交请求模板的主要内容,如果未能解决你的问题,请参考以下文章