bulfaitelo

Ajax

Mar 21st, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $.ajax({
  2.                 url:'/ajax/getClientesEstoque',
  3.                 type: "POST",
  4.                 dataType:'json',
  5.                 cache: false,
  6.                 data:{id:Cliente},
  7.                 beforeSend: function() {
  8.                     //Ação antes de fazer o post dos dados.
  9.                 },
  10.                 success:function(json) {
  11.                     if(json.dados.length > 0){
  12.                         //Carregando a tela com os chamados
  13.                         for(var i in json.dados){
  14.                             //Carregando o vetor para utilização no objeto json.dados[i].campo
  15.                         }
  16.                     }
  17.                 },
  18.                 error:function(jqXHR, textStatus, errorThrown) {
  19.                     alert('Ocorreu um erro. Informe ao ADM do sistema.');
  20.                     console.log("error: " + textStatus);
  21.                     console.log("error Thrown: " + errorThrown);
  22.                     console.log("incoming Text: " + jqXHR.responseText);
  23.                 }
  24.             });
Add Comment
Please, Sign In to add comment