【发布时间】:2013-06-26 09:40:12
【问题描述】:
我有这个简单的咖啡脚本
$(document)
.ready -> $('body') .css -> 'background-color':'black'
编译成
(function() {
$(document).ready(function() {
return $('body').css(function() {
return {
'background-color': 'black'
};
});
});
}).call(this);
之后我有一些控制台错误no method 'replace',有什么问题?非常感谢您的帮助。
【问题讨论】:
-
您似乎错误地使用了 jQuery - 您想做什么?
-
jQuery 的
$(document).ready ->的简写就是$ ->- 请参阅 api.jquery.com/ready 和 stackoverflow.com/questions/6004129/document-ready-shorthand
标签: javascript jquery css coffeescript