[英]Bootstrap 4 Popper.js : How to dynamically update the content of the popup?
我正在嘗試使用來自服務器的Ajax返回的html內容更新來自popper.js
的彈出popper.js
的HTML內容。
彈出頁面是在頁面加載時創建的。 在HTML中:
<a id="upvote-637" title="Popup"
data-toggle="popover"
data-content="<ul><li>item 1</li><li>Item 2</li></ul>"
data-remote="true"
href="/posts/637/upvote">
Link text
</a>
在Javascript中:
$('[data-toggle="popover"]').popover({
trigger: 'hover',
html: true
});
我想動態更新內容。 我試過了 :
// This is working to Toggle display
$("#upvote-637").popover('toggle')
// This is not working to update the content dynamically
$("#upvote-637").popover('toggle')[0].dataset.content = "TEST";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.