Advertisement
fermyth

Ajax Jquery w/ Error handling

Jul 6th, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.40 KB | None | 0 0
  1. // error handling
  2. $.ajaxSetup({"error":function(XMLHttpRequest,textStatus, errorThrown) {
  3.     alert(textStatus);
  4.     alert(errorThrown);
  5.     alert(XMLHttpRequest.responseText);
  6. }});
  7.  
  8. // ajax request using Jquery with POST method, data and function to load when success.
  9. $.ajax({
  10.     type: 'POST',
  11.     url: "data.php",
  12.     data: {
  13.         marker: markerData
  14.         },
  15.     success: function(data){
  16.         loadMarkers();
  17.         }
  18.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement