Calling Ajax repeatedly after specific time using jquery -
searched on jquery timer functions need solution call below ajax function every 5 minutes using jquery..
$.ajax({ type: 'post', url: '<?php echo base_url().'index.php/score-refresh/scorecard';?>', success: function(html){ $('.score_news').append(html); } });
you can using setinterval
call this
var timer, delay = 300000; //5 minutes counted in milliseconds. timer = setinterval(function(){ $.ajax({ type: 'post', url: '<?php echo base_url().'index.php/score-refresh/scorecard';?>', success: function(html){ $('.score_news').append(html); } }); }, delay);
if need stop @ point call
clearinterval(timer);
Comments
Post a Comment