How can I feed a server side Django string array into a client side JavaScript array? -
on server array appears follows:
data = [u'data1', u'data2', u'data3']
in django, send data through client using:
render(..., {'data': data})
on client side try render in javascript using:
{{data}}
and get:
[u'data1b', u'data2', u'data3']
how can fix encoding issue?
you need safe
escape string inorder work fine
{{data|safe|escape}}
Comments
Post a Comment