Page To Be Refresh Automatically

Hi,

I am having a page which i want it to refresh automatically after a number of seconds.

Can anyone please help me in this.

Thnks

Either meta refresh or you could use javascript.

Is there any inbuilt yii extension for autorefresh page.

Hi,

While searching i found this link, but i think it is loading the AR module.

http://www.yiiframework.com/doc/api/1.1/CActiveRecord#refresh-detail

I just want to automatically reload a _view file which is a Clistview after number of seconds, Its the same as user clicks refresh button in the browser.

If you’re refreshing after a few seconds, you need to use one of the options that I’ve suggested. Your option to reload in PHP is gone once you start outputting data to the user’s browser.

The meta refresh is well supported and not dependent on users having javascript installed. The most suitable option depends on your reason for reloading the page. If you explain your use case, someone may be able to suggest a much better option than reloading the page in full.

you can use javascript




function refreshPage() {

   setTimeout("location.reload(true);",5000)"

}

in you body tag just call this function


<body onload="refreshPage()">

Hi,

Thank you all,

I have used the below code at the top of my page and it is working




<script type="text/javascript">

    window.onload = setupRefresh;


    function setupRefresh() {

      setTimeout("refreshPage();", 30000); // milliseconds

    }

    function refreshPage() {

       window.location = location.href;

    }

  </script> 



sanjay1024 Wow it’s working fine thank you lottttt!!!!