jQuery语法错误-无法关闭脚本

jQuery语法错误-无法关闭脚本,jquery,Jquery,由于某种原因,Dreamweaver不允许我关闭jQuery,这似乎是一个语法错误 其概念是拥有一系列具有唯一id的按钮,即4月份的#apr,每个按钮将一个html文件加载到一个div中(称为gigs) 我尝试过移动东西,添加和删除和}),但似乎找不到解决方案 这是到目前为止我的代码 <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="//

由于某种原因,Dreamweaver不允许我关闭jQuery,这似乎是一个语法错误

其概念是拥有一系列具有唯一id的按钮,即4月份的#apr,每个按钮将一个html文件加载到一个div中(称为gigs)

我尝试过移动东西,添加和删除
}),但似乎找不到解决方案

这是到目前为止我的代码

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function(){;

        $("#apr").click(function(){
$("#gigs").load('gigs/april13.html');

        $("#may").click(function(){
$("#gigs").load('gigs/may13.html');

        $("#jun").click(function(){
$("#gigs").load('gigs/may13.html');

        $("#jul").click(function(){
$("#gigs").load('gigs/may13.html');

        $("#aug").click(function(){
$("#gigs").load('gigs/may13.html');

        $("#sep").click(function(){
$("#gigs").load('gigs/may13.html');

        $("#oct").click(function(){
$("#gigs").load('gigs/may13.html');

        $("#nov").click(function(){
$("#gigs").load('gigs/may13.html');

        $("#dec").click(function(){
$("#gigs").load('gigs/may13.html');
    });
});
});
</script>

$(文档).ready(函数(){;
$(“#apr”)。单击(函数(){
$(“#gigs”).load('gigs/april13.html');
$(“#可能”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#jun”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#七月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#八月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#sep”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#十月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#11”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#dec”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
});
});
在我关闭脚本标记之前,错误似乎总是落在最后一行。由于我是jQuery新手,所有的输入都将受到欢迎

编辑:所有链接都指向may,因为今年剩下的时间我还没有创建html文件:)

这是你的问题

$(document).ready(function(){; <---- WHAT IS THAT SEMI COLON DOING THERE???
$(document).ready(function(){;这是您的问题

$(document).ready(function(){; <---- WHAT IS THAT SEMI COLON DOING THERE???

$(document).ready(function(){;您没有关闭单击事件:

$("#apr").click(function(){
$("#gigs").load('gigs/april13.html');
应该是:

$("#apr").click(function(){
    $("#gigs").load('gigs/april13.html');
});

您没有关闭单击事件:

$("#apr").click(function(){
$("#gigs").load('gigs/april13.html');
应该是:

$("#apr").click(function(){
    $("#gigs").load('gigs/april13.html');
});

我修复了每个单击函数末尾缺少大括号、圆括号和分号的问题-请尝试一下:

   <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function(){

$("#apr").click(function(){
    $("#gigs").load('gigs/april13.html');
});

$("#may").click(function(){
    $("#gigs").load('gigs/may13.html');
});

$("#jun").click(function(){
    $("#gigs").load('gigs/may13.html');

$("#jul").click(function(){
    $("#gigs").load('gigs/may13.html');
});

$("#aug").click(function(){
     $("#gigs").load('gigs/may13.html');
});
$("#sep").click(function(){
    $("#gigs").load('gigs/may13.html');
});
$("#oct").click(function(){
    $("#gigs").load('gigs/may13.html');
});
$("#nov").click(function(){
    $("#gigs").load('gigs/may13.html');
});
$("#dec").click(function(){
    $("#gigs").load('gigs/may13.html');
});
});
</script>

$(文档).ready(函数(){
$(“#apr”)。单击(函数(){
$(“#gigs”).load('gigs/april13.html');
});
$(“#可能”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#jun”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#七月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#八月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#sep”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#十月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#11”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#dec”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
});

我修复了每个单击函数末尾缺少大括号、圆括号和分号的问题-尝试一下:

   <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function(){

$("#apr").click(function(){
    $("#gigs").load('gigs/april13.html');
});

$("#may").click(function(){
    $("#gigs").load('gigs/may13.html');
});

$("#jun").click(function(){
    $("#gigs").load('gigs/may13.html');

$("#jul").click(function(){
    $("#gigs").load('gigs/may13.html');
});

$("#aug").click(function(){
     $("#gigs").load('gigs/may13.html');
});
$("#sep").click(function(){
    $("#gigs").load('gigs/may13.html');
});
$("#oct").click(function(){
    $("#gigs").load('gigs/may13.html');
});
$("#nov").click(function(){
    $("#gigs").load('gigs/may13.html');
});
$("#dec").click(function(){
    $("#gigs").load('gigs/may13.html');
});
});
</script>

$(文档).ready(函数(){
$(“#apr”)。单击(函数(){
$(“#gigs”).load('gigs/april13.html');
});
$(“#可能”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#jun”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
$(“#七月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#八月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#sep”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#十月”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#11”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
$(“#dec”)。单击(函数(){
$(“#gigs”).load('gigs/may13.html');
});
});

这里是一个解决方案。这个工具很棒,它可以帮助您看到括号或括号在哪里闭合

问题是您没有关闭每个“加载”呼叫。这些呼叫应该如下所示:

 $("#apr").click(function(){
        $("#gigs").load('gigs/april13.html')**})**;

这是一个解决方案。这个工具很棒,它可以帮助你看到括号或括号在哪里闭合

问题是您没有关闭每个“加载”呼叫。这些呼叫应该如下所示:

 $("#apr").click(function(){
        $("#gigs").load('gigs/april13.html')**})**;

几乎每次
之后都会缺少一个
);
。单击(函数(){ <代码> >响应你的编辑…你真的需要考虑一个更好的方法。仅仅在五月的某个日子里的监听器可能只是一个评估变化的数据包。@凯青,恐怕我还不太熟练,我会喜欢那种功能性的,但是即使这很困惑,你也需要一个代码编辑器。如果你的语法有问题,我会告诉你……你缺少一个
});
在几乎每次
之后。单击(函数(){ <代码> >响应你的编辑…你真的需要考虑一个更好的方法。仅仅在五月的某个日子里的监听器可能只是一个评估变化的数据包。@凯青,恐怕我还不太熟练,我会喜欢那种功能性的,但是即使这很困惑,你也需要一个代码编辑器。我会告诉你你的语法是否有问题…谢谢你的帮助,我现在上传看看它是否有效:),编辑:Absolutey完美,非常感谢:)谢谢你的帮助,我现在上传看看它是否有效:),编辑:Absolutey完美,非常感谢:)