jquery - How to connect two ajax request? -



jquery - How to connect two ajax request? -

i have next code:

<script> $(function () { $('#admincreatenewusersubmit').on('click',function(){ $("#admincreatenewuserform").ajaxform( { target: '#admincreatenewuserformcenter', url: 'update.php', success: function(data) { $("#admincreatenewuserformcenter").html(data); } }); }); }); </script>

this code works, need add together request when given data.

so have tried following:

<script> $(function () { $('#admincreatenewusersubmit').on('click',function(){ $("#admincreatenewuserform").ajaxform( { target: '#admincreatenewuserformcenter', url: 'update.php', success: function(data) { $("#admincreatenewuserformcenter").html(data); $.post("update.php", { cmd:'adminrefreshtabusers' }, function(data){ $('#adminmenutabstatisticgenerate').html(''); $('#adminmenutabstatisticgenerate').html(data); } ); } }); }); }); </script>

but code not work...

what right way connect 2 ajax requests?

the form request gets sent fine, you're updating wrong output field. #adminmenutabstatisticgenerate on statistics page. instead, update #users or 1 of children.

jquery ajax

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -