我趟过javascript(js)文件不执行的坑

由于刚写h5没多久,很多基础知识不太扎实,导致入坑
html文件如下
<!DOCTYPE html>
<html>
<head>
    <title>秒杀详情页</title>
</head>
<body>
<div class="container">
    <div class="panel panel-default text-center">
        <div class="panel-heading">${seckill.name} </div>
        <div class="panel-body">
            <h2 class="text-danger">
                <!--显示time图标-->
                <span class="glyphicon glyphicon-time"></span>
                <!--展示倒计时-->
                <span class="glyphicon" id="seckill-box"></span>
            </h2>
        </div>
    </div>
</div>
<!--登陆弹出层,输入电话-->
<div id="killPhoneModel" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title text-center">
                    <span class="glyphicon glyphicon-phone"></span>秒杀电话:
                </h3>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-xs-8 col-xs-offset-2">
                        <input type="text" name="killPhone" id="killPhoneKey"
                            placeholder="输入手机号码(* ̄︶ ̄)" class="form-control">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <!--验证信息-->
                <span id="killPhoneMessage" class="glyphicon"/>
                <button class="btn btn-success" type="button" id="killPhoneBtn">
                    <span class="glyphicon glyphicon-phone"></span>
                    Submit
                </button>
            </div>
        </div>
    </div>
</div>
</body>
<!-- 以下是我的 javascript 引入-->
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"/>
<%--<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->--%>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"/>
<!--jQuery cookie操作插件-->
<script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"/>
<!--jQuery countDown倒计时插件-->
<script src="https://cdn.bootcss.com/jquery-countdown/2.1.0/js/jquery.countdown.min.js"/>
<!--开始交互代码-->
<script src="/resources/script/seckill.js" type="text/javascript"/>
</html>

这个是我在浏览器上面调试所看到的,只有第一行JavaScript标注了正常的颜色,其他的JavaScript都黯淡无光,这是什么鬼

后面直接把JavaScript引入的代码进行了修改,修改如下

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<%--<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->--%>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!--jQuery cookie操作插件-->
<script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<!--jQuery countDown倒计时插件-->
<script src="https://cdn.bootcss.com/jquery-countdown/2.1.0/js/jquery.countdown.min.js"></script>
<!--开始交互代码-->
<script src="/resources/script/seckill.js" type="text/javascript"></script>

把之前缩减的改成了补全的形式,然后在浏览器上面就看到了焕发光彩的JavaScript引入了,这个坑也是可以的。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值