[英]Bootstrap popover with link and PHP
我試圖使用引導程序彈出窗口彈出確認窗口,然后再從數據庫驅動的表中刪除記錄。 用於使用刪除按鈕生成列的代碼如下所示:
echo "<td> <div class=\"popover-example list-inline\"><a class=\"btn btn-primary\" data-toggle=\"popover\" title=\"Are you sure?\" data-content=\"<a href=\"delete.php?id='. $row->id.' \">Delete</a></div></td>";
我的popover js看起來像這樣:
$(document).ready(function(){
$(".popover-example a").popover({
placement : 'top'
html: 'true'
});
});
我知道,此回聲有點混亂,但它適用於純文本。 我想使帶有動態生成鏈接的HTML出現在poprover中。 有什么辦法嗎? 我將不勝感激。
您可以像這樣在彈出窗口中添加動態和自定義內容
var myDynamicContent = $('<a>').attr('href', 'http://www.yahoo.com')
.text('click here!');
$(".popover-example a").popover({
placement : 'top'
html: 'true'
content: myDynamicContent
});
popover
插件的content
鍵允許您在觸發打開彈出窗口時添加自定義內容。 您也可以將該值作為data-content=""
值嵌入HTML標記中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.