ajax auto refresh page php?

Discussion in 'Digital Media' started by William L, Mar 30, 2008.

  1. William L Guest

    William L
    my problem is : when a new record insert, the latest result can be show in the browser of all user viewing the same page without manually refresh the page.
    eg: user A submit bid =100, user B can view the bid=100 without refresh page manually.
  2. shadow Guest

    You can add a timer with javascript to refresh the website and look for new info every time:

    var interval = setInterval(" Ajaxfunction() ",time);

    On Ajaxfunction you must put the name of the function that searchs for new info, and on time, the NUMBER of milliseconds that you want. That will do it forever, each "time" milliseconds until the page is closed.

    A bit better here:
    var interval = setInterval(" SearchNewData() ",4000);

    To stop doing that, you need to destroy the interval:

    Hope it helped you.
  3. tequila_burp Guest

    you can add a timer. i remember seen a timer in ajax.

Share This Page