Skip to content

Instantly share code, notes, and snippets.

@gcamrit
Last active August 29, 2015 13:56
Show Gist options
  • Save gcamrit/9114252 to your computer and use it in GitHub Desktop.
Save gcamrit/9114252 to your computer and use it in GitHub Desktop.
$.ajax({
type: 'GET',// you can use post also :P
url: ajax.php, // your ajax controller file here
dataType: 'json',
data: { firstcol: firstcol, secondcol: secondcol, thirdcol: thirdcol,id: id,updatecol:true },
beforeSend: function () {
// here we append a loading image
},
success: function (data) {
// successful request; do something with the data
console.log(data);
},
error: function () {
// failed request;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment