0

导航条代码:

<nav class="navbar navbar-default navbar-static-top" role="navigation">
    <div class="container-fluid">

        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Brand</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a href="#">Link</a></li>
                <li><a href="#">Link</a></li>
            </ul>
        </div>

        </div>
</nav>

当引入js为远程文件时:

<script src="http://cdn.gbtags.com/jquery/2.1.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>

当引入js为本地文件时:

<script href="/js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script href="/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>

按下去就不能动了。。。
开始以为是版本问题,我把远程的拷贝到本地后再导入也不能动,有点懵逼

3个回答

0

已采纳

<script href="/js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script href="/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
href换成src就成。

0

找到问题了。。我把script里的src写成href了。。。自杀了

0
<script src="/js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>

撰写答案