我在我的页面中添加了一些Google抓取工具条件。抓取工具正常工作但是当我点击该角色时工作不正常

时间:2016-03-29 06:49:33

标签: c# jquery

我收到错误“Uncaught Syntax Error:Unexpected token ILLEGAL”。加载脚本时。爬虫条件工作正常但不是点击功能。每当我试图点击它不起作用的角色时

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();
    });

0 个答案:

没有答案