I need a way to store HTML from a PHP variable in JavaScript.
var contents = "{{ $template }}";
This generates an error however. I guess it's because it's not escaped properly, So it messes up the web browser, because JS cannot store it properly... I've tried Laravel escaping
var contents = "{{ e($template) }}";
without any success.
The end goal is: $('#preview-iframe').contents().find('html').html(contents);
How can I accomplish this?