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
Post a Comment