开发者

jQuery JS Error on .click()

When I click on the element I get the error uncaught exception: Syntax error, unrecognized expression: . which I'm not sure what to do with.... I see no errors

var tc = $('#tc-woot');
$('.sites .tab', tc).bind('click', function (e) {
    /*$(e.currentTarget).addClass('selected');*/
})开发者_开发问答;

This error is also thrown when I comment out the entire contents of the click event.


Thanks for the help, but it turns out the issue was not in the code I provided, but in another section of code that was applying a listener via .click() to this element when it shouldn't have.


JQuery might not be returning any elements.

Check to make sure your page contains elements that satisfy the "#tc-woot .sites .tab" selector.

Also if the file is encoded in utf-8 you might have invisible characters throwing errors.

It's hard to debug invisible characters. :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜