Some of the information here may be outdated, please check the book instead
[edit]

Here is an example of a complete app:

This function does the computation, here it just sleeps for 5 secs

def background():
    import time
    time.sleep(5)
    return "computation result" # this could an image, HTML, JSON, etc...

This is the page accessed by the user. The computation is called by an ajax call and executed in background.

def foreground():
    return dict(somescript=SCRIPT("ajax('background',[],'target');"),
                somediv=DIV('working...',_id='target'))
© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.