Django javascript escape characters
- by Hulk
There is a text area in which the data is entered as,
122
//Enter button pushed
Address
Name
//Enter button pushed
1
And the same is tored in the db.And the data is fetched in views and returned it to template as,
<script>
{% for i in dict.row_arr %}
var ii= ('{{ i }}');
row_arr.push( ii );
{% endfor %}
</script>
Here there is an error as
Error: unterminated string literal
Line: 40, Column: 12
Source Code:
var ii= ('1212
And when the html source shows up as,
var ii= ('1212
1
21
11212121212');
row_arr.push( ii );
How should the escape function be applied here.
Thanks..