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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -