Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 引导popover在ajax调用中第二次工作_Jquery_Ajax_Twitter Bootstrap_Popover - Fatal编程技术网

Jquery 引导popover在ajax调用中第二次工作

Jquery 引导popover在ajax调用中第二次工作,jquery,ajax,twitter-bootstrap,popover,Jquery,Ajax,Twitter Bootstrap,Popover,当我点击链接时,我没有得到弹出窗口 点击我 它调用ajax方法&获取数据,这是一个类似这样的模板 <html> <div> <p><b> Example</b> </p> </div> </html> 范例 现在我想把这个模板显示为popover,它在第二次点击words时显示出来 我的密码是 <script> $("a[rel=popover]

当我点击链接时,我没有得到弹出窗口

  • 点击我

    它调用ajax方法&获取数据,这是一个类似这样的模板

       <html>
        <div>
        <p><b> Example</b> </p>
        </div>
        </html>
    
    
    范例

    现在我想把这个模板显示为popover,它在第二次点击words时显示出来

    我的密码是

    <script>
    $("a[rel=popover]")
        .click(function(e) {
            e.preventDefault();
            $.ajax({
                url: '/servercall',
                success: function(data) {
            $("#myId").popover({placement: 'top', html:true, trigger: 'click',content: data});
                    }
              });
    
         });
    
    
     </script> 
    
    
    $(“a[rel=popover]”)
    。单击(功能(e){
    e、 预防默认值();
    $.ajax({
    url:“/servercall”,
    成功:功能(数据){
    $(“#myId”).popover({placement:'top',html:true,trigger:'click',content:data});
    }
    });
    });
    
    我搜索了一下,发现设置“数据内容”属性可以解决这个问题。这样地 $(“#myId”).attr('data-content',data.popover('show')


    但是将数据定义为纯文本&而不是与html对齐的格式。

    什么是
    #myId
    ?你有一个我们可以看的例子吗?它是一个超链接<李>