开发者

uncaught exception: Syntax error, unrecognized expression: #

after Ajax response function, I get an error "uncaught exception: Syntax error, unrecognized expression: #"

my code:

var currentState = '';

function clickNavLink() {
    var href = $(this).attr('href');
    if (href == currentState) {
        return false;
    }
    if (document.location.hash != href) {
        document.location.hash = href;
    }
    var link = this;
    //$(this).parent().find('.busy').show();
    currentState = href;  
    $.ajax({
        type: "POST",
        url: "/ajax.php",
        data: "url="+currentState,
        success: function(data){
            $('#container_main').html(data);
            Cufon('.nav a.flevel', { fontFamily: 'Myriad', hover: { color: '#570623' }});
            Cufon.replace('.rblock h2', { fontFamily: 'Myriad' });
            Cufon.replace('.right-col h2', { fontFamily: 'Myriad' });
            Cufon.replace('.over-form h3', { fontFamily: 'Myriad' });
            Cufon('.nav a.flevel', { fontFamily: 'Myriad', hover: { color: '#570623' }});
        }       
    }); 

    return true;
}

jQuery(document).ready(function() {

    $("a").live("hover", function(){
        if($(this).attr('href')!='' && $(this).attr('href')!='#' && $(this).attr('href')!='javascript:;' && $(this).attr('href')[1]!='#'){
            $(this).attr('href','/#'+$(this).attr('href'));
        }
        if($(this).attr('class')=='slevel' || $(this).attr('class')=='slevel'){
            if(this.id){
                $(this).click(clickNavLink);
            }
        }
    });

    $('a.flevel').each(function() { $(this).click(clickNavLink); });
    $('a.slevel').each(function() { $(this).click(clickNavLink); });

    var URL = document.location.toString();
    if (URL.match('#')) {
        var anchor = '#' + URL.split('#')[1];
        $.ajax({
        type: "POST",
        url: "/ajax.php",
        data: "url=/"+anchor,
   开发者_高级运维     success: function(data){
            $('#container_main').html(data);
            Cufon('.nav a.flevel', { fontFamily: 'Myriad', hover: { color: '#570623' }});
        }   
    }); 
    }
});

edited:

http://bradford.webgo.org.ua/#/jobs click one of jobs's menu link and look error line in firebag

error line jquery.js (строка 130) It's not Cufon...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜