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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -