actually that may not work either, you're using a funky nested function syntax...

One way or the other, you just have to get the proper object bound the the lexical scope of the jojo function...

Or something like that... it definitely works....

What version of prototype are you using?

On 6/15/06, Ryan Gahl <[EMAIL PROTECTED]> 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));

On 6/15/06, Sam Rowe < [EMAIL PROTECTED]> wrote:
On Thu, Jun 15, 2006 at 12:24:11PM -0600, Gregory Hill wrote:
# If that doesn't work, then you've done something wrong somewhere.
# 'Cause it works for IE for me and everyone else.
#
# The only advantage I see with the YUI toolkit is that it'll defer
# attaching events to elements that do not yet exist in the DOM.  Big
# whoop, only a sloppy programmer would try to attach an event to a
# non-existant element.  With Prototype, you can bind the handler function
# to an object of your choice and create your own scope.  I didn't see
# that option on the YUI documentation I read. (it automatically binds the
# scope to the element the event acted upon, which is pretty much never
# what I want).
#
# Greg

What am I doing wrong?

http://pastebin.com/711271

Works in FF, in IE I get an error about target.id.

Thanks!
-Sam
_______________________________________________
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

Reply via email to