Ryan Gahl
2006-Jan-11 19:18 UTC
RE: extending the Element.prototype to provideasetAttributes function
No problem, also check out bindAsEventListener for attaching functions to element events, still maintaining your object as the "this" in the event handler scope at the same time having access to the originating "event" object. In case you haven''t found this resource yet: http://www.sergiopereira.com/articles/prototype.js.html -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Jeremy Kitchen Sent: Wednesday, January 11, 2006 1:01 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] extending the Element.prototype to provideasetAttributes function On Wednesday 11 January 2006 10:58, Jeremy Kitchen wrote:> On Wednesday 11 January 2006 10:50, Ryan Gahl wrote: > > No comment on the usefulness of your function, as I''ve yet to tryit.> > But for the "this" scope problem, try this... (removed your var and > > added the bind(this) after the function declaration. I didn''t testit> > though so you might want to give it whirl. It might introduce a > > different scope problem with the "attr" var but I think it shouldwork.> > I''ll give this a try, thanks for your comment :)great! that worked. Thanks again :) -Jeremy ps, sorry for the quick self-reply, I was a bit quick-to-fire on the send button :) -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.
Apparently Analagous Threads
- extending the Element.prototype to provide a setAttributes function
- RE: extending the Element.prototype to provide asetAttributes function
- document.getElementsByClassName (prototype) and Element.childrenWithClassName (scriptaculous) redundancy?
- RE: document.getElementsByClassName (prototype) andElement.childrenWithClassName (scriptaculous) redundancy?
- [prototype] Selector class fails on selector strings with spaces