2008/09/21

Ajax Helpers in 0.2

We will add ajax helpers in version 0.2. You can quickly generate some ajax calls by invoking these helpers. For example


from gaeo.view.helper import ajax

...
# generate a html link and send a request to /foo/bar
self.send_link = ajax.link_to_remote("Click me", "/foo/bar", callback="alert('!');")
...


thus, you can put this generated html in your template:


...
Click this link: {{ send_link }}
...


Of course, since the generated content uses jQuery, you shoud include the jQuery first. You can include it from Google's CDN: http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js

Is 'ajax helpers' a good idea?

0 Comments: