Hello Alfredo,
The problem here is the script tag as you are using it without any attribute as type/language. Please refer https://developer.mozilla.org/en/docs/Web/HTML/Element/scriptfor more details. The script tag if not given type will be treated as JavaScript tag. Hence in your case browser is considering that this script tag contains JavaScript code and giving such errors. For using coffeescript in script tags you can refer http://forgivingworm.wordpress.com/2010/09/27/running-coffeescript-in-browser/ Thanks, Lauree Roberts Ruby on Rails Developer <http://www.allerin.com> Allerin Technologies On Saturday, May 3, 2014 11:54:32 PM UTC+5:30, Alfredo Barrero wrote: > > Hi all, > > I'm starting with Ajax but I have a issue, should be a noobie issue but it > makes me crazy hehe. Could anyone tell me what's going on?. > > I'm following this guide > http://guides.rubyonrails.org/working_with_javascript_in_rails.html, and > with the following code my application does not recognize the action. > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " > http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html> > <head> > <title>Hola Mundo con AJAX, version 2</title> > > <script> > > paintIt = (element, backgroundColor, textColor) -> *SHOW > ERROS LIKE 'unresolved variable or type element'* > element.style.backgroundColor = backgroundColor > if textColor? > element.style.color = textColor > > </script> > > </head> > <body><a href="#" onclick="paintIt(this, '#990000')">Paint it > red</a></body> > </html> > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9496ea2e-4241-4eba-9231-0f1ad63e2983%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

