Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. var data= $('#register-form').serialize();
  2.  
  3. $.ajax({
  4. beforeSend:function(){
  5. console.log(data);
  6. },
  7. type:'POST',
  8. url:'../Controllers/registro.php',
  9. data:data,
  10. success: function(data){
  11. console.log('nanananana');
  12. console.log("soy data"+data);
  13. },
  14. error: function(jqXHR, textStatus, errorThrow){
  15.  
  16. if (jqXHR.status === 0) {
  17.  
  18. alert('Not connect: Verify Network.');
  19.  
  20. } else if (jqXHR.status == 404) {
  21.  
  22. alert('Requested page not found [404]');
  23.  
  24. } else if (jqXHR.status == 500) {
  25.  
  26. alert('Internal Server Error [500].');
  27.  
  28. } else if (textStatus === 'parsererror') {
  29.  
  30. alert('Requested JSON parse failed.');
  31.  
  32. } else if (textStatus === 'timeout') {
  33.  
  34. alert('Time out error.');
  35.  
  36. } else if (textStatus === 'abort') {
  37.  
  38. alert('Ajax request aborted.');
  39.  
  40. } else {
  41.  
  42. alert('Uncaught Error: ' + jqXHR.responseText);
  43.  
  44. }
  45.  
  46. }
  47.  
  48. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement