Skip to content

Instantly share code, notes, and snippets.

@aggresss
Last active November 8, 2018 10:10
Show Gist options
  • Save aggresss/8986f84b8d9af70f82a7168337b32440 to your computer and use it in GitHub Desktop.
Save aggresss/8986f84b8d9af70f82a7168337b32440 to your computer and use it in GitHub Desktop.
ajax-success
$.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