Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.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
我的jQuery文件赢了';不要在任何浏览器中加载_Jquery_Twitter Bootstrap_Browser - Fatal编程技术网

我的jQuery文件赢了';不要在任何浏览器中加载

我的jQuery文件赢了';不要在任何浏览器中加载,jquery,twitter-bootstrap,browser,Jquery,Twitter Bootstrap,Browser,我目前正在尝试使用引导从模板构建一个网站,但我无法加载远程服务器中的任何JS文件。 我已经尝试了这个网站建议的所有解决方案,但都没有成功:当我刷新网页时,参考资料中没有出现JS文件 以下是我的长相: <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> <link rel="stylesheet" type="text/

我目前正在尝试使用引导从模板构建一个网站,但我无法加载远程服务器中的任何JS文件。 我已经尝试了这个网站建议的所有解决方案,但都没有成功:当我刷新网页时,参考资料中没有出现JS文件

以下是我的长相:

<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link href="css/shop-homepage.css" rel="stylesheet">
<link href="css/3-col-portfolio.css" rel="stylesheet">
<script href="js/bootstrap.js"></script>
<script href="js/grindhouseleather.js"></script>
<script href="js/jquery.js"></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GrindHouse Leather</title>
</head>

GrindHouse皮革
我目前正在处理的注册表格主体:

<?php include 'header.php' ?>

<div class="container">

<div class="row">
    <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3">
    <form role="form">
        <h2>Please Sign Up <small>It's free and always will be.</small></h2>
        <hr class="colorgraph">
        <div class="row">
            <div class="col-xs-12 col-sm-6 col-md-6">
                <div class="form-group">
                    <input type="text" name="first_name" id="first_name" class="form-control input-lg" placeholder="First Name" tabindex="1">
                </div>
            </div>
            <div class="col-xs-12 col-sm-6 col-md-6">
                <div class="form-group">
                    <input type="text" name="last_name" id="last_name" class="form-control input-lg" placeholder="Last Name" tabindex="2">
                </div>
            </div>
        </div>
        <div class="form-group">
            <input type="text" name="display_name" id="display_name" class="form-control input-lg" placeholder="Display Name" tabindex="3">
        </div>
        <div class="form-group">
            <input type="email" name="email" id="email" class="form-control input-lg" placeholder="Email Address" tabindex="4">
        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-6 col-md-6">
                <div class="form-group">
                    <input type="password" name="password" id="password" class="form-control input-lg" placeholder="Password" tabindex="5">
                </div>
            </div>
            <div class="col-xs-12 col-sm-6 col-md-6">
                <div class="form-group">
                    <input type="password" name="password_confirmation" id="password_confirmation" class="form-control input-lg" placeholder="Confirm Password" tabindex="6">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-4 col-sm-3 col-md-3">
                <span class="button-checkbox">
                    <button type="button" class="btn" data-color="info" tabindex="7">I Agree</button>
                    <input type="checkbox" name="t_and_c" id="t_and_c" class="hidden" value="1">
                </span>
            </div>
            <div class="col-xs-8 col-sm-9 col-md-9">
                 By clicking <strong class="label label-primary">Register</strong>, you agree to the <a href="#" data-toggle="modal" data-target="#t_and_c_m">Terms and Conditions</a> set out by this site, including our Cookie Use.
            </div>
        </div>

        <hr class="colorgraph">
        <div class="row">
            <div class="col-xs-12 col-md-6"><input type="submit" value="Register" class="btn btn-primary btn-block btn-lg" tabindex="7"></div>
            <div class="col-xs-12 col-md-6"><a href="#" class="btn btn-success btn-block btn-lg">Sign In</a></div>
        </div>
    </form>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="t_and_c_m" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">Terms & Conditions</h4>
            </div>
            <div class="modal-body">
                <!-- Terms and conditions go here -->
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary" data-dismiss="modal">I Agree</button>
        </div>
    </div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>

请注册,这是免费的,永远都是。

我同意 单击注册,即表示您同意本网站规定的内容,包括我们的Cookie使用。
× 条款与条件 我同意
下面是我尝试使用的jQuery脚本:

$(function () {
$('.button-checkbox').each(function () {

    // Settings
    var $widget = $(this),
        $button = $widget.find('button'),
        $checkbox = $widget.find('input:checkbox'),
        color = $button.data('color'),
        settings = {
            on: {
                icon: 'glyphicon glyphicon-check'
            },
            off: {
                icon: 'glyphicon glyphicon-unchecked'
            }
        };

    // Event Handlers
    $button.on('click', function () {
        $checkbox.prop('checked', !$checkbox.is(':checked'));
        $checkbox.triggerHandler('change');
        updateDisplay();
    });
    $checkbox.on('change', function () {
        updateDisplay();
    });

    // Actions
    function updateDisplay() {
        var isChecked = $checkbox.is(':checked');

        // Set the button's state
        $button.data('state', (isChecked) ? "on" : "off");

        // Set the button's icon
        $button.find('.state-icon')
            .removeClass()
            .addClass('state-icon ' + settings[$button.data('state')].icon);

        // Update the button's color
        if (isChecked) {
            $button
                .removeClass('btn-default')
                .addClass('btn-' + color + ' active');
        }
        else {
            $button
                .removeClass('btn-' + color + ' active')
                .addClass('btn-default');
        }
    }

    // Initialization
    function init() {

        updateDisplay();

        // Inject the icon if applicable
        if ($button.find('.state-icon').length == 0) {
            $button.prepend('<i class="state-icon ' + settings[$button.data('state')].icon + '"></i>');
        }
    }
    init();
});
});
$(函数(){
$('.button复选框')。每个(函数(){
//背景
var$widget=$(这个),
$button=$widget.find('button'),
$checkbox=$widget.find('input:checkbox'),
颜色=$button.data('color'),
设置={
关于:{
图标:“glyphicon glyphicon检查”
},
关:{
图标:“glyphicon glyphicon未选中”
}
};
//事件处理程序
$button.on('click',函数(){
$checkbox.prop('checked',!$checkbox.is(':checked');
$checkbox.triggerHandler('change');
updateDisplay();
});
$checkbox.on('change',function(){
updateDisplay();
});
//行动
函数updateDisplay(){
var isChecked=$checkbox.is(“:checked”);
//设置按钮的状态
$button.data('状态',(已检查)?“打开”:“关闭”);
//设置按钮的图标
$button.find(“.state图标”)
.removeClass()
.addClass('state-icon'+设置[$button.data('state')].icon);
//更新按钮的颜色
如果(已检查){
美元按钮
.removeClass('btn-default')
.addClass('btn-'+颜色+'active');
}
否则{
美元按钮
.removeClass('btn-'+颜色+'active')
.addClass(“btn-default”);
}
}
//初始化
函数init(){
updateDisplay();
//如果适用,插入图标
如果($button.find('.state icon')。长度==0){
$button.prepend(“”);
}
}
init();
});
});
jQuery.js是2.1.1版本,我在浏览器中没有收到任何错误消息。。。怎么了?
提前谢谢你

将脚本导入替换为以下内容,然后重试:

<script src="js/bootstrap.js"></script>
<script src="js/grindhouseleather.js"></script>
<script src="js/jquery.js"></script>

脚本标记具有“src”属性,而不是“href”


你需要像
中那样使用src,我是如此多愁善感!!非常感谢,这回答了很多问题!发生在我们当中最好的人身上:)我的第一句话就回答了这个问题。这个问题不值得回答,如果没有主持人,现在无法删除。