I have some sort of a design problem with my Django AJAX application.
I have a template where I initialize js variable from django context variable like so:
var test = "{{ test }}";
This variable is than used in a number of js functions that are needed for interface to work properly.
So now I’m trying to reuse some content from this page in another page that loads it dynamically on some user interaction using jQuery.load(..), and I don’t see any way how I can initialize that variable, so js functions don’t work now.
Is there any solution for this or may be I’m doing it wrong?
Thanks.
Maybe you should include that variable in every page you want to use the js.
Also, you may want to check Context Processors in django: http://docs.djangoproject.com/en/dev/ref/templates/api/