我使用jQuery追加,但一旦你解決如有由Satpal建議所有的JS錯誤,它永遠不會在下拉列表如何從jquery附加文本到div?
for (var key in data)
{
//alert(data[key]["type"] + data[key]["id"] + data[key]["message"]);
//$str = $str+;
$(".notiDiv").append('<div class="row" style="margin: 1px">\n\<div class="col - sm - 8">\n\<a href="#">' user have created a meeting'</a>\n\</div>\n\<div class="form - group col - sm - 4 text - right" >\n\<a><span class=" glyphicon glyphicon - ok"></span></a>\n\<a><span class=" glyphicon glyphicon - remove"></span></a>\n\</div>\n\</div>\n');
}
<div class="dropdown-menu dropdown-menu-custom " >
<div class="notiDiv">
</div>
</div></li>
你的語法錯誤,請檢查瀏覽器控制檯,即使用引號串聯''' + 'user have created a meeting' + '時 – Satpal