我试图根据从服务器收到的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();
},
Run Code Online (Sandbox Code Playgroud)
console.log打印:
<a href = '../editrequest/index.php?q=88>Request id 88</a> was successfully added in the system
Run Code Online (Sandbox Code Playgroud)
但浏览器什么都没显示.