the problem is that coffee creates this in a private scope, so any method from 
inside that scope can't be called..

try

window.testFunction: (param) ->
  alert param

and

testFunction2: (param) ->
  alert param

and check 'compiled' code of both

the function with "window" prefix will be available globally, instead of the 
other one

there's a big difference between (after 'compiling')

(function () {
  var testFunction2 = function(param) {
    alert(param);
   }
}();

and
var testFunction = function(param)
  alert(param);
}

as for the first case, there's no publicly exposed part of the first 
testFunction2 function.

tom

On Jul 23, 2011, at 17:47 , Tomas R. wrote:

> Peter De Berdt wrote in post #1012552:
>> On 23 Jul 2011, at 08:01, Martin Wawrusch wrote:
>> 
>>> Try
>>> 
>>> $ ->
>>>  $('#events a').lightBox()
>>>  $("#slider").easySlider
>>>      auto: true
>>>      continuous: true
>>> 
>>> There is an online js to coffeescript converter out there, I just
>>> can't find the link right now too.
>> 
>> http://ricostacruz.com/js2coffee/
>> 
>> Hope this helps :-)
>> 
>> Best regards
>> 
>> Peter De Berdt
> 
> that's not the problem, the functions are well done. otherwise an alert 
> "hello" should work and i will get an error somewhere in the file.
> 
> and yes, .call(this); is placed inside the file
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
===============================================================================
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com  www.maxwellrender.cz  www.lightgems.cz
===============================================================================

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to