Javascript 引导Popover在本地托管代码时不工作,但在jsbin上工作

Javascript 引导Popover在本地托管代码时不工作,但在jsbin上工作,javascript,jquery,css,twitter-bootstrap,popover,Javascript,Jquery,Css,Twitter Bootstrap,Popover,这太疯狂了。。。我一直在试图弄清楚为什么我的popover代码在本地托管时不会运行,但在jsbin上运行良好。让我知道你们怎么想,我都快疯了。谢谢大家 这就是: jsbin: 很久以前我也有过类似的问题。我是这样解决的:我更改了导入的.css和.js文件的顺序。尝试先加载引导所需的文件,然后加载其他所有文件。希望它也能为你工作!如果没有,那么您的代码就有问题。请尝试声明CSS和JS,不要重复,并且顺序正确: <link href="http://twitter.github.io/bo

这太疯狂了。。。我一直在试图弄清楚为什么我的popover代码在本地托管时不会运行,但在jsbin上运行良好。让我知道你们怎么想,我都快疯了。谢谢大家

这就是:

jsbin:


很久以前我也有过类似的问题。我是这样解决的:我更改了导入的.css和.js文件的顺序。尝试先加载引导所需的文件,然后加载其他所有文件。希望它也能为你工作!如果没有,那么您的代码就有问题。

请尝试声明CSS和JS,不要重复,并且顺序正确:

<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />

<script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" type="text/javascript"></script>
<script src="http://twitter.github.io/bootstrap/assets/js/bootstrap.js" type="text/javascript"></script>

url末尾缺少最后一个脚本,如果您有一个正在工作的jsbin,您也可以发布它。调试控制台中出现了什么错误?奇怪的是,没有!申报怎么样http://twitter.github.io/bootstrap/assets/js/bootstrap-popover.js 就在tagbootstrap-popover.js之前不需要,因为它已经包含在bootstrap.js中
  /*///// relevant HTML: Targets (pop1,2,3) & Triggers (Previous & Next buttons) ///////*/

        <a  href="#" id="pop1" class="btn" data-content="GREAT CONTENT3" data-original-title="Gamification 1/3">
        </a>

        <a  href="#" id="pop2" class="btn" data-content="GREAT CONTENT3" data-original-title="Gamification 3/3">
        </a>


        <a href="#" id="pop3" class="btn" data-content="GREAT CONTENT3" data-original-title="Gamification 3/3">
        </a>


<a href="#" id="NextBtn" class="btn btn-primary"> NEXT </a>

<a href="#" id="PreviousBtn" class="btn btn-primary"> PREVIOUS </a>



    /*///// CSS ///////*/

      var currentPopover = -1;
      var popovers = [];

     // Initialize all the popovers to be "manually" displayed.
   popovers.push($("#pop1").popover({ trigger: 'manual' }));
   popovers.push($("#pop2").popover({ trigger: 'manual' }));
   popovers.push($("#pop3").popover({ trigger: 'manual' }));


    // On each button click, hide the //currently displayed popover
    // and show the next one.



    $("#NextBtn").click(function() {
    if (currentPopover >= 0) {
    popovers[currentPopover].popover('hide');
    }

    currentPopover = currentPopover + 1;
    popovers[currentPopover].popover('show');


    });


    $("#PreviousBtn").click(function() {

    popovers[currentPopover].popover('hide');


    currentPopover = currentPopover  -1;
    popovers[currentPopover].popover('show');


    });
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />

<script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" type="text/javascript"></script>
<script src="http://twitter.github.io/bootstrap/assets/js/bootstrap.js" type="text/javascript"></script>