Skip to content

Instantly share code, notes, and snippets.

@sihugh
Created May 29, 2015 11:10
Show Gist options
  • Save sihugh/aed0270220261a603265 to your computer and use it in GitHub Desktop.
Save sihugh/aed0270220261a603265 to your computer and use it in GitHub Desktop.
Handle SharePoint Errors in JQuery Success Handler
$.ajax({
headers: { "X-RequestDigest": formDigestValue },
url: url,
method: "POST",
contentType: "application/json",
data: submitData,
success: function(data){
if(data.indexOf("<meta name=\"SharePointError\"") > 0){
// oh noes!
// error handling
}
else {
//we're good!
}
},
error: error
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment