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?
Try the
escapejsfilter: