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:
Post a Comment