Jquery请求API,AJax,Post,Get提交,失败,错误的处理
参考地址:https://api.jquery.com/jQuery.post/
Jquery get请求 $.get()
Jquery post请求 $.post
Jquery post请求失败:.fail
JavaScript 全选
// Assign handlers immediately after making the request,
// and remember the jqxhr object for this request
var jqxhr = $.post("example.php",
function() {
alert("success");
}).done(function() {
alert("second success");
}).fail(function() {
alert("error");
}).always(function() {
alert("finished");
});
// Perform other work here ...
// Set another completion function for the request above
jqxhr.always(function() {
alert("second finished");
});
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
post 管理员