相关疑难解决方法(0)

Bootstrap popover内容无法动态更改

我使用如下代码:

$(".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)

在此调用之后,元素中的数据将被更改,但不会显示在显示的弹出框中.

我该怎么办?

jquery popover twitter-bootstrap

59
推荐指数
5
解决办法
7万
查看次数

标签 统计

jquery ×1

popover ×1

twitter-bootstrap ×1