4

I have this code but when there's a problem and the console log this error

Uncaught SyntaxError: Unexpected end of input

$(function () {
       var clicks = 0;
      setLike('<?php echo $notrepage ?>');
      FB.Event.subscribe('edge.create', function (response) {
         if (getcookie('<? url_to_cookie($fbpage) ?>')) {
            setLike('<?php echo $autrepage;?>');
            var clicks = 1,
            cooo = <? url_to_cookie($autrepage) ?> ;
         } else if (clicks == 1) {
            setcookie(cooo, '1', 350);
            $("#inner-follow").remove();
            $("#likeplay").remove();
            document.getElementById("dsfsd").style.display = 'none';
            document.getElementById("dsfsd").style.visibility = 'hidden';
            document.getElementById("videos").style.display = 'block';
            document.getElementById("videos").style.visibility = 'visible';
            getViedo();
         } else if (clicks = 0) {
            setLike('<?php echo $fbpage; ?>');
           var  clicks = 1,
            cooo = <? url_to_cookie($fbpage); ?> ;
         }

      });

Thank you :)

simyos
  • 305
  • 1
  • 3
  • 10

2 Answers2

8

You must be mising either a } or ) or both something like })

ErickBest
  • 4,586
  • 5
  • 31
  • 43
  • I confirmed this for myself by comparing between versions of the file to find which `}` I was mising. – Ben Feb 14 '22 at 13:12
4

SyntaxError: Unexpected end of input means that the file ended, while the parser expected that there was more. This is usually caused by a typo, or a missing ) or }. Count the amount of opening ( and { and count the amount of ) and }. If they are not the same, you should figure out where you forgot to close them.

Sumurai8
  • 20,333
  • 11
  • 66
  • 100