myClass = Class.create();
myClass.prototype =
{
initialize: function()
{
myElementClicked: function(e)
{
};{
//initialization code...
Event.observe(myElement, "click", this.myElementClicked.binAsEventListener(this));
},Event.observe(myElement, "click", this.myElementClicked.binAsEventListener(this));
myElementClicked: function(e)
{
//use e
},The above will work cross-browser. Otherwise, in the example you gave, you can do the following in myFunc...
function myFunc(e){
if (!e) e = window.event
;
//use e
}//use e
On 6/15/06, Sam Rowe <[EMAIL PROTECTED]> wrote:
On Thu, Jun 15, 2006 at 08:44:13AM -0500, Ryan Gahl wrote:
# Um... Event.observe() -- it's been there all along and does that
# abstraction.
Weird, I wonder why none of my event handlers work in IE. I'll look closer.
Thanks for the info.
Just cause I'm dense... I'm talking about this:
Event.observe(myelement,'click',myfunc);
function myfunc(e){
// deal with e like I would in FF
}
Are we talking about the same thing?
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs