Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/438.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.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
Javascript 为什么boostrap.js没有加载?_Javascript_Jquery_Twitter Bootstrap - Fatal编程技术网

Javascript 为什么boostrap.js没有加载?

Javascript 为什么boostrap.js没有加载?,javascript,jquery,twitter-bootstrap,Javascript,Jquery,Twitter Bootstrap,我在中尝试了以下代码-它可以工作,但是,这在我自己的本地计算机上不起作用 原因可能是什么 <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css"> <script href='http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstr

我在中尝试了以下代码-它可以工作,但是,这在我自己的本地计算机上不起作用

原因可能是什么

<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<script href='http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js'></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>    

<input type="button" id="loading-example-btn" data-loading-text="Loading..." class="btn btn-primary" value = "loading state">

<script>    
  $('#loading-example-btn').click(function () {
      var btn = $(this)
      btn.button('loading')    
  });
</script>

$(“#加载示例btn”)。单击(函数(){
var btn=$(此)
按钮(“加载”)
});

您必须在
doucment.ready
函数中编写jQuery脚本,而且您已经在
booststrap.js
之后加载了jQuery库,应该在

试试这个:

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>

<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<script src='http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js'></script>

<input type="button" id="loading-example-btn" data-loading-text="Loading..." class="btn btn-primary" value = "loading state">    

<script>

    $(document).ready(function()
    {

      $('#loading-example-btn').click(function () {
        var btn = $(this)
        btn.button('loading')

      });
    });
</script>

$(文档).ready(函数()
{
$(“#加载示例btn”)。单击(函数(){
var btn=$(此)
按钮(“加载”)
});
});

脚本标记没有href属性。它包含src属性

所以


将正常工作。

您需要在引导之前加载jQuery。JSFIDLE很可能是为您这样做的。如果您费心检查您的开发控制台,您可能会看到关于
$
未定义的错误
是否有效?尝试使用
href
vs
src
)。
<script src='http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js'> </script>