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 -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -