我有一个Bootstrap弹出窗口,我正试图放入一个表格,但是当它点击时它不会显示出来。这是第一次在popover中尝试HTML,所以我不确定如何正确地做到这一点。谢谢!把表放入Bootstrap弹出窗口
$(function(){
$("[data-toggle=popover]").popover({
html : true,
content: function() {
var content = $(this).attr("data-popover-content");
return $(content).children(".popover-body").html();
},
title: function() {
var title = $(this).attr("data-popover-content");
return $(title).children(".popover-heading").html();
}
});
});
<a role="button" class="btn btn-link btn-item black-text" data-toggle="popover" data-trigger="focus" data-placement="top" title="Currency Converter" data-content="Displayed rates are only for informational purposes and do not reflect on the actual rates you may be charged by the financial institution handling your transaction.
<table class='table table-condensed table-bordered'>
<tr><td>Euro</td><td>€79,123</td></tr>
<tr><td>GB Pound</td><td>£46,536</td></tr>
<tr><td>AU $</td><td>$123,456</td></tr>
</table>LLC accepts payment in US Dollars only. Rates do not include taxes, duties, shipping, insurance, or any other expenses associated with the purchase."><i class="fa fa-exchange"></i> Currency converter</a>
我不知道是否这就是主要原因或没有,但你缺少一个引号 - “ - 在您的按钮。在它说处理您的交易的最后。 – Skywalker
我觉得你试图在HTML标签内部嵌入HTML标签,这至少是非常糟糕的做法。 – Jason
@ user2190986因为内容仍然存在,所以此处没有引号。 –