gpt4 book ai didi

jquery - 在 html 网格中显示 html 代码

转载 作者:行者123 更新时间:2023-11-28 03:43:31 25 4
gpt4 key购买 nike

newcontent += 
"<tr id=\"" + a[i][0] + "\">
<td class=\"row\">" + a[i][0] + "</td>
<td>" + a[i][4] + "</td>
<td>" + a[i][3] + "</td>
<td>" + a[i][1] + "</td>
<td class=\"edit\">
<img class=\"editrow\" name=\"" + a[i][2] + "\" src=\"../images/1321797859_edit.png\" />
<img class=\"deleterow\" name=\"" + a[i][2] + "\" src=\"../images/1321787179_edit-delete.png\" />
<a href=\"../interface/qb-topic.aspx?c=" + qsParm[key] + "&id=" + a[i][2] + "\">
<img class=\"showrow\" src=\"../images/1325079018_application_view_detail.png\" />
</a>";

我从 ajax 函数获取值到 [i][1]。这个值是 html 代码,就像一些用 ckeditor 写的文本。但这不显示(抱歉我的语言不好)。

[{"rownum":"1","Id_questions":"6","Text_questions":"

تست3

","Level":"آسان","topic":"درخت"},{"rownum":"2","Id_questions":"5","Text_questions":"تست3

","Level":"سخت","topic":"تقسیموغلبه"},{"rownum":"3","Id_questions":"3","Text_questions":"تست","Level":"سخت","topic":"درخت"},{"rownum":"4","Id_questions":"2","Text_questions":"خوووسط","Level":"متوسط", "topic":"تقسیم و غلبه"},{"rownum":"5","Id_questions":"1","Text_questions":"نام و غلبه"},{"rownum":"5","Id_questions":"نام و غلبه","Level":"آسان","topic":"تقسیم و غلبه"}]

它是我从数据库中获取的 json 字符串。并且在 4 行中首先有 html 代码。 “تست3 ”在

标签中。这是我的问题,我无法解决。

最佳答案

您正在调用二维数组方法,但您的答案在结构中。如果你不想得到那个,那么就这样写......

newcontent += 
"<tr id=\"" + a[i]["rownum"] + "\">
<td class=\"row\">" + a[i]["rownum"] + "</td>
<td>" + a[i]["Text_questions"] + "</td>
<td>" + a[i]["Text_questions"] + "</td>
<td>" + a[i]["Id_questions"] + "</td>
<td class=\"edit\">
<img class=\"editrow\" name=\"" + a[i]["Text_questions"] + "\" src=\"../images/1321797859_edit.png\" />
<img class=\"deleterow\" name=\"" + a[i]["Text_questions"] + "\" src=\"../images/1321787179_edit-delete.png\" />
<a href=\"../interface/qb-topic.aspx?c=" + qsParm[key] + "&id=" + a[i]["Text_questions"] + "\">
<img class=\"showrow\" src=\"../images/1325079018_application_view_detail.png\" />
</a>";

关于jquery - 在 html 网格中显示 html 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8703008/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com