AJAX Div Retrieval every 60 seconds

纵饮孤独 提交于 2019-12-01 14:52:15

How about using a framework like jQuery to simplify your javascript:

$(function() {

  setInterval(function() {
    $.get('ajax_table.php', function(data) {
      $('#ajax_table').html(data);
    });
  }, 60 * 1000);

});

At first, there's no js function ajax_table() called in

setTimeout('ajax_table()',60000);

in your code.

At second point, are you sure you are calling moniter() function somewhere for the first time?

Try this, You can retrieve the contents of a PHP file and insert it into a div for every 60 seconds http://www.webtrickss.com/ajax/how-to-refresh-a-div-using-ajax/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!