Advertisement
randomCodes

customer.js

Nov 16th, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function(){
  2.    
  3.    //SELETOR, EVENTO OU EFEITO, CALLBACK E AÇÃO
  4.    $('.j_formsubmit').submit(function(){
  5.       var form = $(this);
  6.       var data = $(this).serialize();
  7.  
  8.       $.ajax({
  9.           url: 'ajax/customer.php',
  10.           data: data,
  11.           type: 'POST',
  12.           dataType: 'json',
  13.             beforeSend: function () {
  14.                 form.find('.img_load').fadeIn(500);
  15.                 console.log('Teste do console -----');
  16.             },
  17.             success: function (resposta) {
  18.                
  19.                 if(resposta.error){
  20.                     console.log('Não funcionou');
  21.                 }else{
  22.                    console.log('Funcionou');
  23.                 }
  24.                 form.find('.img_load').fadeOut(500);
  25.             }
  26.       });
  27.      
  28.        return false;
  29.    });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement