开发者

jQuery JS Error on .click()

开发者 https://www.devze.com 2023-02-08 10:36 出处:网络
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

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

精彩评论

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