Skip to content

Instantly share code, notes, and snippets.

@orhanobut
Created September 21, 2013 08:09
Show Gist options
  • Save orhanobut/6648441 to your computer and use it in GitHub Desktop.
Save orhanobut/6648441 to your computer and use it in GitHub Desktop.
Simple ajax code structure
$.ajax({
type: "POST",
url: "file_upload.php",
data: yourData,
dataType: "json",
success: function (result) {
if (result.success) {
//your cod
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment