Reputation: 3925
Suppose this is a part of my django template:
<div class="txt"></div>
<script>
$(document).ready(function(){
var text = '{{ each.text }}'
$('.txt').html(text);
});
</script>
So this code is messing my output.Suppose the string returned by django to this template is This is great'thing
.So here the output is only This is great
.So how can I escape quotes and blockquotes in javascript?
Upvotes: 0
Views: 98
Reputation: 53366
Check how to escape html text in template. Refer template filter escape
Upvotes: 0