taco =
{
init: function()
{
jojo: function(e)
{
};{
this.x = $("myelement");
Event.observe(this.x, "click", this.jojo.bindAsEventListener(this) );
},Event.observe(this.x, "click", this.jojo.bindAsEventListener(this) );
jojo: function(e)
{
alert(Event.element(e).id);
}Event.observe(window, "onload", taco.init );
...After I looked harder I realized your main problem isn't that scope thing... it's that "target" is not a valid property of IE's Event object... lol sorry I was so blind...
so using Event.element(e).id was really all you were looking for... my bad!! I'm just going to leave the above code like that though so you can see a working example of bindAsEventListener()...
On 6/15/06, Sam Rowe <[EMAIL PROTECTED]> wrote:
On Thu, Jun 15, 2006 at 01:50:41PM -0500, Ryan Gahl wrote:
# jojo is a member method of taco (in your previous posts I think both me
# and Greg assumed your function was at the global scope level)...
#
# change your Event.observe line to the following...
#
# Event.observe(x,'click', this.jojo.bindAsEventListener(this));
Sorry to be dense. I changed it and now IE gives me an error that
this.jojo is null or not an object.
http://pastebin.com/711299
_______________________________________________
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