0

I am getting an error "Uncaught Syntax Error: Unexpected token ILLEGAL". when the script is loaded.The crawler condition is working fine but not the click functionality. whenever i am trying to click on the character it is not working

jQuery(function ($) {
        //  Listen for Click
        $(".serving-nav a").click(function (e) {

            //  Get the Character
            var theChar = $(this).data('alpha');

            //  Hide Others
            $(this).parent().find('a').not($(this)).removeClass('active');

            //Check userAgent to serve organic number to Googlebots
            var gb = navigator.userAgent.toLowerCase().indexOf('googlebot');

            //Check userAgent to serve organic number to Bingbots
            var bb = navigator.userAgent.toLowerCase().indexOf('bingbot');

            //Check userAgent to serve organic number to MSNbots
            var mb = navigator.userAgent.toLowerCase().indexOf('msnbot');

            //For Blocking Animation through QueryString
            var qrStr = window.location.toString();
    //Crawler Condition
            if (((gb > 0) || (bb > 0) || (mb > 0)) || (qrStr.indexOf('animation=false') > 0))
             {
                 //to show all the list at once if the crawler condition is satisfied
                $(".serving-data .serving-nav-data").show();
            }
            else {
                $(".serving-data .serving-nav-data").stop(true, true).slideUp(500);
            }
            // $(".serving-data .serving-nav-data").show();

            //  Show the Related
            $(this).addClass('active');
            $(".serving-data .serving-nav-data[data-alpha='" + theChar + "']").stop(true, true).slideDown(500);

            //  Prevent Default
            e.preventDefault();
            return false;
        });

        //  Trigger Click on Active One
        $(".serving-nav a.active").click();
    });
Nikhil
  • 71
  • 1
  • 9
  • the error is coming from somewhere else. theres nothing wrong with the above. – BenG Mar 29 '16 at 07:26
  • Possible duplicate of [No visible cause for "Unexpected token ILLEGAL"](http://stackoverflow.com/questions/12719859/no-visible-cause-for-unexpected-token-illegal) && (http://stackoverflow.com/questions/12680072/uncaught-syntaxerror-unexpected-token-illegal) && (http://stackoverflow.com/questions/28396807/javascript-uncaught-syntaxerror-unexpected-token-illegal) – JP. Aulet Mar 29 '16 at 07:36
  • NO this is not duplicate – Nikhil Mar 29 '16 at 09:04

0 Answers0