I have a set of A tags that I would like to watch unobtrusively. I
have given them all the same classname, and I want to use invoke to
set them up, rather than each. Am I trying to do something that won't
work?
var blah = function(){
//this function would do way more than this
alert (this);
}
$$('a.more').invoke('observe','click',blah);
This works fine, but I want to stop the event, and none of these do
the trick:
this.stop()
Event.stop(this)
or even extending the invoke with an additional argument after blah
and using that as the event.
$$('a.more').invoke('observe','click',blah,'evt');
The only way I have been able to hack it to actually do what I want
is to set this.href to null. Which feels wrong in many ways.
What's the right way to do this -- unobtrusively setting these links
to not work, yet leaving them alone for those who don't have JS
enabled? Can I do this with invoke or do I need to get out and push
with each?
Thanks in advance,
Walter
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---