繁体   English   中英

jQuery无法以HTML作为内容追加到有序列表

[英]Jquery cannot append to a ordered list with HTML as content

我试图根据从服务器收到的JSON响应追加到有序列表。 响应包含HTML标记,由于某种原因它们没有以HTML呈现。我为响应消息做了一个console.log,看起来还不错。 但是,当我将此添加到我的列表时,它不会显示在屏幕上。

我在后端使用jquery和PHP / Mysql的ajax调用。

这是jquery代码段:

 success: function (response) {
                    var responsedata = jQuery.parseJSON(response);
                    console.log(responsedata.msg);
                    $('#step3ul2').append("<li>"+responsedata.msg+"</li>");
                    $("#finalmsgsuccessdiv").show();    
                    },

console.log打印:

<a href = '../editrequest/index.php?q=88>Request id 88</a> was successfully added in the system

但是浏览器什么也没显示。

可能是'a'标记上的href属性没有关闭单引号吗?

<a href = '../editrequest/index.php?q=88>

<a href = '../editrequest/index.php?q=88'>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM