Perhaps instead of using render_to_response to generate the response,
render the template output to a string and then stuff that in the data
structure that you serialise to json along with the other data?

Regards,
Matt

On Jun 16, 1:17 pm, Alex <alexle...@googlemail.com> wrote:

>
> But the problem I have - and I may be thinking about this in the wrong
> way - is that I also want to pick out some variables from the response
> to use in my js success callback. If I wasn't using django templating
> this could be straightforwardly achieved with a JSON response parsed
> client side. So my difficulty is that I want both a rendered template
> response and some JSON response in the same callback... I have thought
> about 'enriching' the render_to_response context with these additional
> variables, inserting them in hidden html fields and then querying the
> dom for their values - but that feels awkward and also means the
> response has to be added to the dom before the js can act on their
> values.
>
> This seems like a familiar nut that must be well documented
> somewhere... :) any help, pointers very appreciated.
>
> Thanks
>                   Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to