how to make multiple ajax query work on all browsers with jQuery -
am working on project , found little problem ajax request finding hard fix. want perform multiple ajax requests, in mean: need perform ajax request, , if successful, perform ajax request within success handler.
here sample of code:
var result; $.post('make_payment.php',{password:pass,amount:50},function(data){ result=data; if(result=='success'){ $.ajax({ type:'post', datatype:"json", url:"save_info.php", success: function(data){ if(data.result=='success'){ alert('success'); } }, error:function(){ alert('failed'); } }); } })
this works pretty on mozilla firefox , google chrome, not work on internet explorer , apple safari. pls need assistance on how make work on browser.
trying using datatype:"jsonp" instead of datatype:"json" . i'm not sure of reason long had same issue , got fixed change
Comments
Post a Comment