0

I'm not sure why I'm getting this error, as I can't see anything wrong with my eyes.

In NetBeans on Line 9 I'm getting "Expected , but found ;"

jQuery(document).ready(function($){
    $(".scroll").click(function(event){event.preventDefault();
        $('html,body').animate({scrollTop:$(this.hash).offset().top},500);
    });
    $("#accordion".accordion({
        collapsible:true,
        active:false,
        heightStyle:"content"
    });
    $("#menu-mobile img").click(function(){
        $('nav ul.menu').toggleClass("show");
    });
    $("#signup").click(function(){
        $(".members-form-wrapper#new-user").slideDown("slow");
    });
    $('#postcode').on('change',function(event){if(inputHasContent($(this))){
            $('.details').show();
        }else{
            $('.details').hide();
        }
    });
});

I'm trying desperately to minify the load time on my wordpress install and encountering errors when i try to improve.

Something just tells me, that this is something really simple... but I just can't see it. Any help appreciated!

Lee
  • 4,187
  • 6
  • 25
  • 71

2 Answers2

2

You have forgot to close brackets in the 5th line.

Change

 $("#accordion".accordion({
        collapsible:true,
        active:false,
        heightStyle:"content"
    });

to

 $("#accordion").accordion({
        collapsible:true,
        active:false,
        heightStyle:"content"
    });
Farhad Jabiyev
  • 26,014
  • 8
  • 72
  • 98
  • 1
    I knew it would be something simple! If you don't mind me asking, did you use any tools.. or do you just use a logical approach and proof-read slowly? – Lee Mar 25 '14 at 11:02
  • @LeeCollings )) Nope, I didn't use any tools. I just read your code carefully. – Farhad Jabiyev Mar 25 '14 at 11:04
  • @LeeCollings, see [How can I debug my JavaScript code?](http://stackoverflow.com/questions/988363/how-can-i-debug-my-javascript-code) for tools, etc. – Liam Mar 25 '14 at 12:26
0

you forgot to close '#accordion' braces

$("#accordion").accordion({
        collapsible:true,
        active:false,
        heightStyle:"content"
    });
Sudharsan S
  • 15,336
  • 3
  • 31
  • 49