[英]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.