Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.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 常见问题解答引导示例-->不工作在引导上有脚本错误_Javascript_Jquery_Twitter Bootstrap - Fatal编程技术网

Javascript 常见问题解答引导示例-->不工作在引导上有脚本错误

Javascript 常见问题解答引导示例-->不工作在引导上有脚本错误,javascript,jquery,twitter-bootstrap,Javascript,Jquery,Twitter Bootstrap,我有下面的html。它由引导和css url文件组成。它有两个手风琴项目标签。但发现它在打开时有javascript错误。当我点击手风琴时,它不会显示答案。有什么不对吗 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name = "viewport"

我有下面的html。它由引导和css url文件组成。它有两个手风琴项目标签。但发现它在打开时有javascript错误。当我点击手风琴时,它不会显示答案。有什么不对吗

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
   <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
    <h3>Default collapse with scaling icon</h3>
        <div class="panel-group" id="faqAccordion0">
        FAQ Sample Test
                <div class="panel panel-default ">
                    <div class="panel-heading accordion-toggle question-toggle collapsed" data-toggle="collapse" data-parent="#faqAccordion0" data-target="#0">
                        <h4 class="panel-title"> 
                            <a href="#" class="ing">
                                Testing Question 1 Title
                            </a>
                          </h4>
                    </div>
                    <div id="0" class="panel-collapse collapse" style="height: 0px;">
                        <div class="panel-body">
                            <h5><span class="label label-primary">Answer</span></h5>
                            Testing Question 1 Content
                        </div>
                    </div>

                </div>
                <div class="panel panel-default ">
                    <div class="panel-heading accordion-toggle question-toggle collapsed" data-toggle="collapse" data-parent="#faqAccordion0" data-target="#1">
                        <h4 class="panel-title"> 
                            <a href="#" class="ing">
                                Testing Question 2 Title
                            </a>
                          </h4>
                    </div>
                    <div id="1" class="panel-collapse collapse" style="height: 0px;">
                        <div class="panel-body">
                            <h5><span class="label label-primary">Answer</span></h5>
                            Testing Question 2 Content
                        </div>
                    </div>
                </div>
        </div>
    </div>
</body>
</html>

错误告诉您还需要包括jQuery

<script 
  src="https://code.jquery.com/jquery-3.2.1.min.js"
  integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
  crossorigin="anonymous">
</script>
确保在包含bootstrap.js脚本之前包含jQuery

默认使用缩放图标折叠 常见问题样本测试 答复 测试问题1内容 答复 测试问题2内容