Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // wrapuje se u neku func ako je potrebno i stavi se neki triger
- var ajax_url= nw_php_vars.ajax_url;
- var nonce= nw_php_vars.nonce;
- jQuery.ajax({
- url: ajax_url,
- data:{
- 'action':'ime funkcije',
- '_wpnonce':nonce,
- 'data':jQuery('.form').serialize()// posaljes nesto od podataka za obradu
- },
- dataType: 'HTML',
- beforeSend: function() {
- // neka loader animacija
- },
- success:function(data){
- // nesto uradis sa povratnom informacijom
- },
- error: function(errorThrown){
- // logujes gresku
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement