码迷,mamicode.com
首页 > Web开发 > 详细

总是容易忘记 jquery ajax POST

时间:2016-01-28 13:51:40      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:

 1 $.ajax({
 2     //提交数据的类型 POST GET
 3     type:"POST",
 4     //提交的网址
 5     url:"testLogin.aspx",
 6     //提交的数据
 7     data:{Name:"sanmao",Password:"sanmaoword"},
 8     //返回数据的格式
 9     datatype: "html",//"xml", "html", "script", "json", "jsonp", "text".
10     //在请求之前调用的函数
11     beforeSend:function(){$("#msg").html("logining");},
12     //成功返回之后调用的函数             
13     success:function(data){
14         $("#msg").html(decodeURI(data));
15     }   ,
16     //调用执行后调用的函数
17     complete: function(XMLHttpRequest, textStatus){
18         alert(XMLHttpRequest.responseText);
19         alert(textStatus);
20         //HideLoading();
21     },
22     //调用出错执行的函数
23     error: function(){
24         //请求出错处理
25     }
26 }); 

 

总是容易忘记 jquery ajax POST

标签:

原文地址:http://www.cnblogs.com/sunscheung/p/5165869.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!