fabiorocha

Untitled

Aug 16th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.55 KB | None | 0 0
  1.    var jqxhr = $.ajax( {
  2.             url: "http://viacep.com.br/ws/23092205/json/?callback=?",
  3.             beforeSend: function( xhr ) {
  4.                 alert( "Antes de enviar" );
  5.             }})
  6.             .done(function() {
  7.                 alert( "sucesso" );
  8.             })
  9.             .fail(function() {
  10.                 alert( "error" );
  11.             })
  12.             .always(function() {
  13.                 alert( "completo" );
  14.             });
  15.             jqxhr.always(function() {
  16.                 alert( "sempre passa aqui" );
  17.             });
Add Comment
Please, Sign In to add comment