I'm trying to inject a string containing html elements into a div, but by the way, I only get it if the entire code is on one line.
(我正在尝试将包含html元素的字符串注入div,但是顺便说一句,我只在整个代码都在一行上的情况下才得到它。)
This is what I am getting when push from database and try to inject in div This is the problem
(这是从数据库推送并尝试注入div时得到的结果, 这就是问题所在)
I tried to leave this code on one line and it worked This is how it should work
(我试图将这段代码放在一行上,并且它起作用了这就是它应该起作用的方式)
this is my code:
(这是我的代码:)
var html = <%=data.long_description%>
var html_string = html.replace("
"," ")
console.log(html_string)
var iframe =document.getElementById("descript")
iframe.innerHTML = html_string
Only problem is that I am using innerHTML, as I will not be able to do all this manually.
(唯一的问题是我正在使用innerHTML,因为我将无法手动完成所有这些操作。)
Does anyone know how fix / leave all / html code in one line?(有谁知道如何在一行中修复/保留所有/ html代码?)
ask by bruno fiverr translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…