Created
May 29, 2015 11:10
-
-
Save sihugh/aed0270220261a603265 to your computer and use it in GitHub Desktop.
Handle SharePoint Errors in JQuery Success Handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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