''字符串文字包含未转义的换行符错误

时间:2020-06-09 12:11:30

标签: javascript php codeigniter

我在$ faq ['content']中有一个文本;当我回显$ faq ['content']时,此错误显示在浏览器控制台中:

' ' string literal contains an unescaped line break Error

我的代码:

<script>
setTimeout(function () {
$(".opencxbody").html('<div style="max-height:400px; overflow-y: scroll;"> <?php echo $faq['content']; ?></div>');
}, 100);
</script>

1 个答案:

答案 0 :(得分:0)

请重试。

<script>
setTimeout(() => {
            let data = "<div style='max-height:400px; overflow-y: scroll;'>";
                data += "<?=$sss?>";
                data += "</div>";
            $(".opencxbody").html(data);
        }, 100);
</script>