我使用如下代码:
$(".reply").popover({
content: "Loading...",
placement: "bottom"
});
$(".reply").popover("toggle");
Run Code Online (Sandbox Code Playgroud)
这正确地创建了popover及其内容.我想在不关闭弹出窗口的情况下将新数据加载到弹出框中.
我尝试过以下方法:
var thisVal = $(this);
$.ajax({
type: "POST",
async: false,
url: "Getdes",
data: { id: ID }
}).success(function(data) {
thisVal.attr("data-content", data);
});
Run Code Online (Sandbox Code Playgroud)
在此调用之后,元素中的数据将被更改,但不会显示在显示的弹出框中.
我该怎么办?