-7

My console is returning this error:

Uncaught SyntaxError: Unexpected end of input 

I know what it means, but i can't find where i did not close correctly my bracket.

This is the URL of my website, http://bit.ly/KJz5pi

If anybody can solve it, i will be so much glad! Thanks.

--------- EDIT

I cut a big part of my code, and it's showing this error just in this small slice of code:

$("#slider-index").bxSlider({
    delay: 3000,
    speed: 5000,
    pause: 1000,
    controls: false,
    auto: true,
    pager: false,
    adaptativeHeight: true,
    adaptativeWidth: true,
    mode: 'fade'
});


function persiana() {
    $('.one').animate({
        left: '-35px'
    }, 1500, 'linear', function() {
        $(this).css('left', '0');
        persiana();
    });
}

persiana();

and yet, I don't see the error, not even jshint.com finds it!

tshepang
  • 12,111
  • 21
  • 91
  • 136
Fernando Ferrari
  • 551
  • 6
  • 21
  • Post your code here, not a link to your website(especially since you used a short link that we can't see what it goes to), and preferably what code is causing the issue. We are not here to just look for syntax errors. – jzworkman Jan 09 '14 at 17:18
  • I am sorry, the code is too extensive, thought this would be simpler. Should I really post it here? – Fernando Ferrari Jan 09 '14 at 17:18
  • 5
    Then use a proper editor, and it will highlight it for you. – adeneo Jan 09 '14 at 17:18
  • 2
    **Nobody with a fear of mouths should click that link.** – Pointy Jan 09 '14 at 17:19
  • Simpler for you maybe, but no one here wants to search for your syntax error any more than you do. Thats not what this site is for. – jzworkman Jan 09 '14 at 17:19
  • Try here http://jshint.com – elclanrs Jan 09 '14 at 17:21
  • The thing is that i am using NetBeans and it doesnt point it out for me. It seems to be correct. Using it in localhost same thing, it works fine. Js hint same thing. This is driving me crazy. – Fernando Ferrari Jan 09 '14 at 17:24
  • So sorry, but i do not think it is a syntax error, since i find my syntax errorless, and other tools does as well. – Fernando Ferrari Jan 09 '14 at 17:39
  • @FernandoFerrari The console was showing error at the wrong line. I checked error on other parts of code and found the problem. Check the answer. – Dhiraj Jan 09 '14 at 18:22
  • @FernandoFerrari It seems like you don't want to acknowledge all the efforts I made to debug your code. Or you just don't care about the answer anymore? – Dhiraj Jan 15 '14 at 19:00
  • 1
    I am sorry Dhiraj, I really appreciate your effort in helping me! I went for vacation and did not check stack anymore. I found yesterday what was the problem, my filezilla was messing up my code when i uploaded it to the server, because i had comments in my script those comments were commenting some part of the code that they shouldnt. – Fernando Ferrari Feb 05 '14 at 13:22

2 Answers2

2

Use this. Paste in your javascript. Presto. However, we can't hold your hand through it. Lint will find syntax and logic errors. Focus on the syntax error and don't get lost on the logic stuff. Just get your code working.

http://www.javascriptlint.com/online_lint.php

Xavier J
  • 4,326
  • 1
  • 14
  • 25
2

Took me little long to debug your code but I think I found where the problem is. Actually, the problem isn't with the code that you have shown us. The problem is somewhere else. You have missed to close two function. Look at the code below:

$(document).ready(function () {
        $(".newsletter").colorbox({
            iframe: true,
            width: "500px",
            height: "310px"
        });
        $(".mapa-site").colorbox({
            iframe: true,
            width: "600px",
            height: "420px"
        });
        $(".webdesign").colorbox({
            iframe: true,
            width: "450px",
            height: "300px"
        });
        $(".area-restrita").colorbox({
            iframe: true,
            width: "500px",
            height: "300px"
        });
        var posicao = $(".menu ul li a.active").parents().position().left + ($(".menu ul li a.active").parents().width() / 2) - 10;
        $(".bola").css({
            left: posicao
        });
        $(".menu ul li a").click(function (e) {
                e.preventDefault();
                var _this = $(this);
                var posicao = _this.parents().position().left + (_this.parents().width() / 2) - 10;
                $(".bola").animate({
                    'left': posicao
                }, 'slow');
                $(".menu ul li a").removeClass('active');
                $(this).addClass('active');
                var dataSlider = _this.attr('data-slide-index');
                var conteudoLi = $("#li_" + dataSlider).html();
                novoLeft = dataSlider * 964 * -1;
                if ($("#li_" + dataSlider).attr('data-height')) {
                    novoHeight = $("#li_" + dataSlider).attr('data-height');
                } else {
                    novoHeight = $("#li_" + dataSlider).outerHeight();
                }
                $('.viewport').animate({
                    left: novoLeft
                }, 'slow', 'swing');
                $('#content').animate({
                    height: novoHeight
                }, 'slow');

So, if you add two more lines after that code, your problem will be fixed.

     }); //For $("menu ul li a").click(function) {
}); // For $(document).ready(function) {
Dhiraj
  • 1,871
  • 1
  • 12
  • 15