> I hope web.py can provide us AJAX func.
>

It sure can. :-)  An AJAX request is just a normal request, but initiated
via JavaScript and returning XML or JSON. For example, a web.py handler that
grabs the number of users on your site and returns it as JSON (untested):

class num_users:
    def GET(self):
        n = web.select('users', what='count(*) as n')[0].n
        web.header('Content-Type', 'text/plain')
        print '[%d]' % n

DecentURL.com uses an AJAX-style request like this for its live "grabbing
title" feature. See the docs for api-title here:
    http://decenturl.com/tools#api-title

And here's the AJAX JavaScript that calls this:
    http://static.decenturl.com/common.js

-Ben

-- 
Ben Hoyt, http://benhoyt.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to