librelist archives

« back to archive

autorefresh in flask

autorefresh in flask

From:
jamal sasha
Date:
2013-02-10 @ 01:29
Hi,

   How do you refresh a page (view) every n seconds in flask.
I tried adding javascript refresh

<script type="text/javascript">
    window.onload = setupRefresh;

    function setupRefresh() {
        setTimeout("refreshPage();", 30); // milliseconds
    }
    function refreshPage() {
        window.location = location.href;
    }
</script>

But its not working.

Re: autorefresh in flask

From:
jamal sasha
Date:
2013-02-10 @ 01:31
eh.. sorry for spamming.. fixed it :)
Thanks


On Sat, Feb 9, 2013 at 5:29 PM, jamal sasha <jamalshasha@gmail.com> wrote:

> Hi,
>
>    How do you refresh a page (view) every n seconds in flask.
> I tried adding javascript refresh
>
> <script type="text/javascript">
>     window.onload = setupRefresh;
>
>     function setupRefresh() {
>         setTimeout("refreshPage();", 30); // milliseconds
>     }
>     function refreshPage() {
>         window.location = location.href;
>     }
> </script>
>
> But its not working.
>

Re: [flask] autorefresh in flask

From:
Andy D'Arcy Jewell
Date:
2013-02-10 @ 08:31
On 10/02/13 01:29, jamal sasha wrote:
> Hi,
>
>    How do you refresh a page (view) every n seconds in flask.
> I tried adding javascript refresh
>
> <script type="text/javascript">
>     window.onload = setupRefresh;
>
>     function setupRefresh() {
>         setTimeout("refreshPage();", 30); // milliseconds
>     }
>     function refreshPage() {
>         window.location = location.href;
>     }
> </script>
>
> But its not working.
Hi Jamal,

A better way is to use "<meta http-equiv="refresh" content="60">" in the 
header to refresh the page every 60 seconds. Adjust "60" to whatever 
value suits you. I believe the vast majority of browsers support this 
even if they don't support javascript.

-Andy

Re: [flask] autorefresh in flask

From:
Hugo Ruscitti
Date:
2013-02-10 @ 16:41
Hi Jamal, if you want to refresh a page to speed up your programming
workflow
you can use livejs instead:

http://livejs.com/

it's only recommended in developer environments.


2013/2/10 Andy D'Arcy Jewell <andy@wild-flower.co.uk>

> On 10/02/13 01:29, jamal sasha wrote:
> > Hi,
> >
> >    How do you refresh a page (view) every n seconds in flask.
> > I tried adding javascript refresh
> >
> > <script type="text/javascript">
> >     window.onload = setupRefresh;
> >
> >     function setupRefresh() {
> >         setTimeout("refreshPage();", 30); // milliseconds
> >     }
> >     function refreshPage() {
> >         window.location = location.href;
> >     }
> > </script>
> >
> > But its not working.
> Hi Jamal,
>
> A better way is to use "<meta http-equiv="refresh" content="60">" in the
> header to refresh the page every 60 seconds. Adjust "60" to whatever
> value suits you. I believe the vast majority of browsers support this
> even if they don't support javascript.
>
> -Andy
>



-- 
Hugo Ruscitti

www.pilas-engine.com.ar
www.losersjuegos.com.ar
www.gcoop.coop