2013-03-18 43 views
0

我不能使用自舉酥料餅加載遠程HTML數據加載遠程HTML。 以下是我的代碼。我想這從下面無法使用自舉酥料餅(AJAX)

Load a Bootstrap popover content with AJAX. Is this possible?

<a href="#" id="oneData" class="divAnchor" rel="popover" 
      load-remote-data="TestGetJson.htm">Bootstrap popover with ajax data</a> 

下面這段代碼在腳本標籤。當調試使用Firebug我從服務器獲取 反應,但它不是在屏幕上顯示。從服務器

<div class="popover fade bottom in" ><div class="arrow"></div><h3 class="popover-title">pop Over Title</h3><div class="popover-content">Data From Server</div></div> 

在我的代碼中使用以下進口

<script type="text/javascript" src="js/jquery-1.7.js"></script> 
<link href="css/bootstrap-popover.min.css" rel="stylesheet" media="screen"/> 
<script type="text/javascript" src="js/bootstrap-popover.min.js"></script> 
+0

在控制檯 – 2013-03-18 08:54:10

+0

@ArunPJohny任何錯誤,謝謝。我不知道我們可以在firebug控制檯中檢查javascript錯誤。它解決了。問題與文件「js/bootstrap-popover.min.js」。它沒有popover方法。 – suresh 2013-03-18 09:26:03

+0

@suresh - 歡迎堆棧溢出。偉大的你的問題解決了!考慮給自己的問題添加一個答案,以便每個人都知道你的問題已經解決。謝謝! – Marijn 2013-03-18 09:33:17

回答

0

問題

$(document).ready(function() { 
    $('#oneData').bind('click',function(){ 
     var e=$(this); 
     //e.unbind('click'); 
     $.get(e.attr('load-remote-data'),function(data){ 
      e.popover({content: data, placement:'bottom', html:true}).popover('show'); 
     }); 
    }); 
}); 

反應是與錯誤的文件導入。因此將這個問題標記爲已回答。