Last active
November 8, 2018 10:10
-
-
Save aggresss/8986f84b8d9af70f82a7168337b32440 to your computer and use it in GitHub Desktop.
ajax-success
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
type: "POST", | |
url: url, | |
contentType: "application/json; charset=utf-8", | |
data: JSON.stringify(data), | |
dataType: "json", | |
statusCode: { | |
200: function() {alert("成功")} | |
}, | |
error: function(xhr, status, error) { | |
alert("失败," + xhr.responseText) | |
} | |
}); | |
} | |
// Reference: http://api.jquery.com/jquery.ajax/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment