On Sat, Aug 8, 2009 at 6:34 PM, WilsonOfCanada<w...@sfu.ca> wrote: > > I am not sure; I am just trying to pass the variable from the > dictionary using render_to_response to a javascript function. The > function is stored as a .js file. This is a part of the code I am > using it for: > > <label for="selectArea"></label>{{ selectCity|safe }}<br/> > > <select class="normal" name="selectProvince" id="selectProvince" > onchange = "changeArea({{ mooman | safe | escapejs}});"> > <select> > > The {{ selectCity|safe }} works but the {{ mooman | safe | escapejs}} > does not. I was wondering if the syntax is incorrect or they cannot > be used between " ". Please show an example. >
Why don't _you_ show us the generated HTML code and point out what's unexpected about it? It will be much easier for us to help you. A stab in the dark, since I have no idea what the content of mooman might be: Maybe you want onchange="changeArea('{{ mooman|safe|escape }}');" ? (Note the additional quotes around your {{ }} expression) Matthias --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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 -~----------~----~----~----~------~----~------~--~---