开发者

where to find jQuery or CoffeeScript tutorials?

in rails 3.0 was working:

$("a.delete_link").bind("ajax:success", function() {
$(this).clo开发者_JAVA技巧sest("tr").fadeOut();
});

Where to find information how to make it work this on rails 3.1 jquery script to work under .js.coffee or need to make new file?


Are you trying to convert this to CoffeeScript? Decent intro here or at the official site. Not sure of any more in depth, free tutorials.

As far as jQuery tutorials, you really can't beat Jeffrey Way's course.

For what it's worth, what you have would be

$("a.delete_link").on "ajax:success", ->
   $(@).closest("tr").fadeOut()

Use 'on' directly instead of calling 'bind', but I'm not sure what "ajax:success" is. Possibly a custom callback function? There is an ajaxSucess() jQuery function, but not quite clear on what you're trying to do.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜