Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 15th, 2012  |  syntax: JavaScript  |  size: 0.60 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $.ajax({
  2.                 async: false,
  3.                 type: 'get',
  4.                 url: url,
  5.                 data: { parametro:parametro },
  6.  
  7.                 beforeSend: function(){
  8.                     //as ações que irá fazer antes de mandar o ajax normalmente coloca um loader
  9.                    
  10.  
  11.                 },                
  12.                 success: function(data){
  13.                    
  14.                         //esse data é a resposta do ajax
  15.                    
  16.                 },              
  17.                 error: function(erro){
  18.                         //aki é se der um erro
  19.                 }
  20.             });