Granted, that’s a lot more code, but there’s a lot less magic. You can, of course, implement a lot of this magic in template tags. Simple Googling shows that this has already been done, but rather poorly from my point of view.
The Django way should probably look like this:
<a href="#" onclick="{{ posts.ajax.reload|effect:highlight }}">
Submit to AJAX
</a>
using context variables with proper methods to render the JavaScript and some handy filters to add any effects.
no subject
In Django, we use various views that spit out partial results, which you would have to write anyway, and use jQuery for the loading and the effects.
For
rik's example of:
we'd write, by hand, using jQuery:Granted, that’s a lot more code, but there’s a lot less magic. You can, of course, implement a lot of this magic in template tags. Simple Googling shows that this has already been done, but rather poorly from my point of view.
The Django way should probably look like this:
using context variables with proper methods to render the JavaScript and some handy filters to add any effects.