javascript - Trigger the setinterval after post data is received -
i've got jquery $post() bring data when page loads. i've got setinterval() load other data when page loads.
$.post('my.php', { send:"123" }, function(resp){ //trigger setinterval });
how trigger setinterval after data being received?
var wait = setinterval(function() { //do }, 1000);
function myintervalfunction() { // something, interval function } // start general interval working process setinterval(myintervalfunction, 1000); $.post('my.php', { send:"123" }, function(resp){ // trigger myintervalfunction once // after ajax call finished myintervalfunction(); } );
Comments
Post a Comment