Re: return html snippet via XHR with simplejson

2007-08-11 Thread Udi
If you just want to return html that will get dumped into a container via innerHTML, then I don't really see the need to return json. Just return the html as text/html and dump the response directly into the container. However, the approach you are taking is nice because it lets you add more met

Re: return html snippet via XHR with simplejson

2007-08-11 Thread olivier
Hi, > This seems pretty appropriate to me, but as I am relatively new to > python and django, I was wondering if others are doing something > similar or if there are other suggestions for returning the html > formatted. Well, I'm doing roughly the same thing... I would be interested to see if o

return html snippet via XHR with simplejson

2007-08-10 Thread r_f_d
I was wondering what people are doing to format html snippets returned via XHR. I am currently using code like: response_dict = {} t = ModelObject.objects.all() html_table = render_to_response('table_template.html', {'table': t}) response_dict.update({'table': html_table}) return HttpRespon