I have a Rails backend which sends strings like
<p>Hello world</p>
etc.
But no matter what I do
$('div#target').after(...) or $('div#target').html(...)
The string remains sanitized. How can I make it into valid HTML?
Note: on my client I only have a <script>
tag
Code bit that sends the string:
function main() {
jQuery(document).ready(function($){
var body = "<%= @body %>";
$('script#parentdiv').after("<div class='parent'></div>");
$('.parent').html(body);
});