diff --git a/chapter2/mysite/myapp/static/scripts/index.js b/chapter2/mysite/myapp/static/scripts/index.js index c66f226..5ec6d67 100755 --- a/chapter2/mysite/myapp/static/scripts/index.js +++ b/chapter2/mysite/myapp/static/scripts/index.js @@ -3,6 +3,8 @@ var symptomName = last_month_day(); $(function(){ //更新抓取信息 + setInterval(function(){ + $.ajax('/myapp/api/crawl_info.json').done(function(data){ console.log(data); $('#crawl_info_total_count').html(data.total_count); @@ -21,6 +23,8 @@ $(function(){ $('#tasks_count').html(data.tasks); }); + }, 1500); + init(); init2();