我想将使用JavaScript编写的jQuery函数转换为Coffeescript,该函数将两个函数作为参数。我是Coffeescript的新手,我有点卡在这里。原始功能类似于:如何将带有两个函数参数的jQuery函数转换为Coffeescript
$('#target').toggle(function() {
alert('First handler for .toggle() called.');
}, function() {
alert('Second handler for .toggle() called.');
});
它在Coffeescript中的外观如何?
http://aaronrussell.co.uk/articles/using -coffeescript-with-jquery/ –