Skip to content

Instantly share code, notes, and snippets.

@aegiz
Created March 31, 2017 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aegiz/4b8c3e0e445a6f0525487be93d368f7c to your computer and use it in GitHub Desktop.
Save aegiz/4b8c3e0e445a6f0525487be93d368f7c to your computer and use it in GitHub Desktop.
Make AJAX request with Jquery
var callAjax = function(url, type, data, callback) {
$.ajax({
url: url,
type: type,
data: data,
success: function(result) {
if(callback) {
callback(result);
}
}, error: function(MLHttpRequest, textStatus, errorThrown) {
console.log(errorThrown);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment