我想在 CoffeeScript 中做类似的事情:
word_list = [{ text: "cat", weight: 23 }, { text: "mouse", weight: 10 }, { text: "fox", weight: 5}, { text: "lion", weight: 4}, { text: "giraffe",weight: 3}, {text: "zebra", weight: 2},{ text: "bat", weight: 20 }, { text: "rat", weight: 11 }, { text: "duck", weight: 4}, { text: "dinosaur", weight: 100}, { text: "flamingo",weight: 50}, {text: "kangaroo", weight: 8},]
$(function() {
$("#chart").jQCloud(word_list);
});
我会这样打电话吗?
jQuery ->
$("#chart").jQCloud(word_list);
还是我需要做类似的事情
$ ->
$chart.jQcloud(word_list);