I\'m trying to call a javascript function from a Coffeescript file, for my $(document).ready()
and it\'s never getting called.
The function I want to call c
This doesn't do what you think it does:
$ -> ready
In JavaScript that is:
$(function() {
return ready;
});
Your problem is that just ready
is simply a reference to the function, it is not a function call like it would be in Ruby. You'd have to say ready()
to call the function, the function calling parentheses are only optional when you're calling a function with arguments: f x
and f(x)
are the same but f
and f()
are different.
I think you want to say:
$ -> ready()
or even:
$ ready # same as $(ready)