[英]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.