Skip to content

Instantly share code, notes, and snippets.

@intruxxer
Last active June 2, 2019 18:26
Show Gist options
  • Save intruxxer/8144513 to your computer and use it in GitHub Desktop.
Save intruxxer/8144513 to your computer and use it in GitHub Desktop.
Format of AJAX with POST type using jQuery
$.post(url, { comment: text }, function(data) {
alert(data);
});
//or
$.ajax(url, { data: { title: text1, comment: text2 },
type: "POST",
beforeSend: function() {
alert("before send");
},
error: function() {
alert("error");
},
success: function(data) {
alert(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment