Re: problem while passing a list of string to javascript in template

2012-12-29 Thread Everest K.C.
Thank you nimesh very much. It worked for me. Masklinn I didn't get your point. Can you please explain? -- With Regards, Everest K.C. BE Computer Engineering Institute of Engineering, Pulchowk Campus URL: http://www.everestkc.com.np -- You received this message because you are subscribed to the

Re: problem while passing a list of string to javascript in template

2012-12-29 Thread Masklinn
On 2012-12-29, at 19:59 , Ryan Blunden wrote: > Django presumes all template variables are "unsafe" by default to prevent XSS > attacks which is why it's encoded the quotes. > > Read up on filters and auto-escaping and you'll be able to figure out the > rest. Realizing that the string serializ

Re: problem while passing a list of string to javascript in template

2012-12-29 Thread nimesh ghelani
use mark_safe: from django.utils.safestring import mark_safe ticks = mark_safe(["a", "b", "c", "d"]) On Saturday, December 29, 2012 9:27:55 PM UTC+5:30, Everest K.C. wrote: > > Hello Everyone, > I have problem while passing a list of string from django views to > javascript template. The quotati

Re: problem while passing a list of string to javascript in template

2012-12-29 Thread Ryan Blunden
Django presumes all template variables are "unsafe" by default to prevent XSS attacks which is why it's encoded the quotes. Read up on filters and auto-escaping and you'll be able to figure out the rest. Cheers, Ryan On 29/12/2012, at 7:57 AM, "Everest K.C." wrote: > Hello Everyone, > I have