Advertisement
LukaPetrovic

ono sto ide u js fajl

Sep 28th, 2015
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. // wrapuje se u neku func ako je potrebno i stavi se neki triger
  2. var ajax_url= nw_php_vars.ajax_url;
  3. var nonce= nw_php_vars.nonce;
  4. jQuery.ajax({
  5.     url: ajax_url,
  6.     data:{
  7.         'action':'ime funkcije',
  8.         '_wpnonce':nonce,
  9.         'data':jQuery('.form').serialize()// posaljes nesto od podataka za obradu
  10.     },
  11.     dataType: 'HTML',
  12.     beforeSend: function() {
  13.             // neka loader animacija
  14.     },
  15.     success:function(data){
  16.                 // nesto uradis sa povratnom informacijom
  17.             },
  18.     error: function(errorThrown){
  19.                 // logujes gresku
  20.             }
  21.     });
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement