Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#register-submit').click(function(){
- var data= $('#register-form').serialize();
- $.ajax({
- beforeSend:function(){
- console.log(data);
- },
- type:'POST',
- url:'../Controllers/registro.php',
- data:data,
- dataType:"json",
- success: function(data){
- console.log('nanananana');
- console.log("soy data"+data);
- },
- error: function(jqXHR, textStatus, errorThrow){
- if (jqXHR.status === 0) {
- alert('Not connect: Verify Network.');
- } else if (jqXHR.status == 404) {
- alert('Requested page not found [404]');
- } else if (jqXHR.status == 500) {
- alert('Internal Server Error [500].');
- } else if (textStatus === 'parsererror') {
- alert('Requested JSON parse failed.');
- } else if (textStatus === 'timeout') {
- alert('Time out error.');
- } else if (textStatus === 'abort') {
- alert('Ajax request aborted.');
- } else {
- alert('Uncaught Error: ' + jqXHR.responseText);
- }
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement