Re: passing variable values in javascript being served statically

2010-05-29 Thread gvkalra
Hi. here is the code: http://pastebin.com/HtNq52aV what i am trying to do:: get the visitor location from his IP address in {{latitude}} and {{longitude}} . get my business location in {{BUSINESS_LOCATION}} . then trace a route from visitor location to my business location. On May 25,

Re: passing variable values in javascript being served statically

2010-05-24 Thread Daniel Roseman
On May 24, 8:24 pm, gvkalra wrote: > Hi. > I am trying to do something like this: > > views.py > > return render_to_response('abc.html',{'variable':value}) > > abc.html > > > dummy = {{variable}}; > > > > My problem: > I am not able to use dummy inside xyz.js ... OR is

Re: passing variable values in javascript being served statically

2010-05-24 Thread gvkalra
yes it is a js problem .. But I was looking for a way in which I can use Django Variables passed by a view function inside a statically served js ... since it's static, the template engine won't parse it . On May 25, 12:38 am, Rodrigue Villetard wrote: >

Re: passing variable values in javascript being served statically

2010-05-24 Thread Rodrigue Villetard
Hello, I think you can use xyz.js as a template : return render_to_response('xyz.js' > > {'variable':value}) > Your problem is more a javscript problem of variable visibility as doesn't properly make an include. regards. 2010/5/24 gvkalra > Hi. > I am trying to do

passing variable values in javascript being served statically

2010-05-24 Thread gvkalra
Hi. I am trying to do something like this: views.py return render_to_response('abc.html',{'variable':value}) abc.html dummy = {{variable}}; My problem: I am not able to use dummy inside xyz.js ... OR is there some other way by which I can use {{variable}} inside xyz.js ?? -- You