开发者

Problems with jQuery bind()

I'm getting an Unexpected TOKEN illegal error on the following javascript:

$(function() {  
    $(‘.delete_post’).bind(‘ajax:success’, function() {  
        $(this).closest(‘tr’).fadeOut();  
    });  
});

I've done quite a bit of research and can't seem to fi开发者_如何转开发nd any issue with this code. The error is being thrown on the 2nd line. The .delete_post refers to a Destroy link class that should be removing elements from a page.

Any thoughts?

EDIT: The actual error given in the Chrome console is:

Uncaught SyntaxError: Unexpected token ILLEGAL


It looks like you're using back-tics instead of single quotes (apostrophes).

-- Per comments --

They're not backticks, they're left single quotes (thanks Gabi). Unfortunately, That's still probably enough to throw off the JS Engine. If you didn't mean to type them that way your editor is doing it automagically. What platform / editor are you working with?


 delete('quotes')

Is looking a bit different in my preview

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜