javascript - Send data to client page from mysql database without refreshing page (timeout) -


i created tabulation system beauty pageants show judges score on projector. created presentation page using codeigniter.

the html presentation page purely written in javascript. page refreshes each second real-time data sent judges.

the not-so-cool thing logic when page writes lot of data, page blinks every second. refreshing of page noticeable , disturbing.

this snippet of code i'm working on.

$(document).ready(function() {                 getjudgesscore();                  setinterval(function(){                     if (getnumfinalists() == 0)                         getjudgesscore();                     else {                         window.open ('presentationfinalists','_self',false)                     }                      },1000);             }); 

you can imagine how data being sent , received every time code executed.

to sum up, want accomplish instead of client asking data every second, server initiates connection every time new data saved database. thank taking time reading concern.

presentation page

this might take necessary data mysql server , send client page. timer jquery run after perticular time of interval.

        <script src="../js/timer/jquery.timer.js"></script>         var timer = $u.timer(function() {           getjudgesscore();         });         timer.set({time: 1000, autostart: true}); 

refer link https://code.google.com/p/jquery-timer/source/browse/trunk/jquery.timer.js?r=12


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -