On Aug 24, 4:00 pm, Gustavo Henrique <gustavo...@gmail.com> wrote: > Hi! > I'm sending unicode string for template page, whitin a javascript > code, and I have a problem with the char u before string value. > For example: > > <script> > {{ string|safe }} -->// {'fieldLabel': u'Cliente', 'name': u'cliente', > 'value': u''} > </script> > > In the body there isn't a problem, but in the javascript code it isn't > a valid code. > > How can I remove this u?
If you want to supply a dictionary in a format that Javascript will understand it, your best bet is to encode it as JSON. from django.utils import simplejson simplejson.dumps(mydict) -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---