<div class="follower-list">
<?php if (!$publications) { ?>
Henüz paylaşılan bir yayın bulunmamaktadır.
<?php } else {
for ($i = 0; $i < count($publications); $i++) {
?>
<div class="media">
<div class="media-body">
<div class="col-sm-11">
<i class="fa fa-file-text"></i> <?=$publications[$i]["content"]?>
</div>
<div class="col-sm-1">
<button class="btn btn-default" onclick="$.delete_publication('<?=$publications[$i]["id"]?>')">Kaldır</button>
</div>
</div>
</div>
<?php }
} ?>
<div class="mb20"></div>
<button class="btn btn-primary" id="add_new_publication">Yeni Yayın Ekle</button>
<div class="input-group" id="div_publications" style="display: none;">
<input class="form-control" type="text" id="input_publication" name="publication" placeholder="Yayın Adı">
<span class="input-group-btn">
<button type="button" class="btn btn-success" onclick="$.save_new_publication(<?=$USER_ID?>);">Kaydet</button>
<button type="button" class="btn btn-danger" onclick="$.cancel_new_publication();">İptal</button>
</span>
</div>
</div><!--follower-list -->
我動態地添加一些文字,但我希望以後最後的媒體類追加項目
這裏補充說明的是我的JS:
$(".media").append('<div class="media"><div class="media-body"><div class="col-sm-11"><i class="fa fa-file-text"></i> ' + response.content + '</div><div class="col-sm-1"><button class="btn btn-default" onclick="$.delete_publication(' + response.id + ')">Kaldır</button></div></div></div>');
追加的工作,但其附加的div畢竟有一個media
類的div。但是我想追加最後的media
。