I use something like lowpro's behaviors (
http://svn.danwebb.net/external/lowpro/tags/rel_0.5/dist/lowpro.js)
and http://encytemedia.com/event-selectors.My code looks like that and
I haven't use write js in the htm file for years:
CD3.Behaviors({
'#someElement': {
'click': Site.onClick,
'custom:event' Site.onCustomEvent
},
'select': CD3.Select, // this CD3.Select is class
'ul li.tab:click: Site.activateTab
});
This kind of work helps my to separate my logic from view. It also
helps when some other developers comes to the project.
p.s. http://next.pixeldepo.com/files/behaviors.js <- here is my
CD3.Behaviors but if someone is interested.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---