ajax('{{=URL('dta')}}','[ ]','target')
Em 16/04/2016 14:03, "Steve Joe" <[email protected]> escreveu:

> I am trying to show the user the recent 6 db entries at every 5 secs. But
> it doesn't seem to work!
> What am I doin wrong here?
>
> view:
>
> <script>
>     window.setInterval(function(){
>   ajax('{{=URL('dta')}}','target');
> }, 5000);
>
> <div><p id='target'> </p>
> </div>
>
>
> controller:
>
> def dta():
>     size=len(db(db.chats.id>0).select())
>     lower=size-5
>     if size-5<=0:
>         lower=0
>         jj=db(db.chats.id>0).select(limitby=(lower-1, size))
>     return jj
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to