Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: "POST",
- url: "MyUrl",
- data: "val1=test",
- success: function(result){
- // Do stuff
- }
- });
- $.ajax({
- type: "POST",
- url: "MyUrl",
- data: "val1=test",
- success: function(result){
- if (result.error == "true")
- {
- alert("An error occurred: " & result.errorMessage);
- }
- else
- {
- // Do stuff
- }
- }
- });
- $.ajaxSetup({
- error: function(xhr){
- alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
- }
- });
- header('HTTP/1.0 419 Custom Error');
- $.ajax({
- type: "POST",
- url: "MyUrl",
- data: "val1=test",
- success: function(result){
- // Do stuff
- },
- error: function(request,status,errorThrown) {
- // There's been an error, do something with it!
- // Only use status and errorThrown.
- // Chances are request will not have anything in it.
- }
- });
Add Comment
Please, Sign In to add comment