There should be no "tricks" to get this working : ) Passing element to $ should extended it with all Element.Methods.* defined for that element type. I really have no clue why this would fail. Exactly which element (i.e. its tagName) are you calling method on?
-- kangax On Jun 28, 4:21 pm, mocambo <[EMAIL PROTECTED]> wrote: > My testing results on both way: > > 1. ------------------------------------ > Object.extend(Element.Methods, { > ownMethod: function(element) { > // ... > } > > }); > > Element.addMethods(); > > and > > 2. ------------------------------------ > Element.addMethods({ > ownMethod: function(element) { > // ... > } > > }); > > Element.ownMethod($('someDiv')); works on FF, Safari and IE as > expected on both way. > > $('someDiv').ownMethod(); works still only on FF and Safari. Not on IE > "Object doesn't support > this property or method". > > I think there's no more tricks to get $('someDiv').ownMethod(); > working on IE? :) > > On Jun 28, 4:09 am, kangax <[EMAIL PROTECTED]> wrote: > > > This should work (at least in recent versions of prototype). > > Have you tried passing an object with methods explicitly? > > > Element.addMethods({ > > ownMethod: function(element) { > > // ... > > } > > > }) > > > -- kangax > > > On Jun 27, 7:41 pm, mocambo <[EMAIL PROTECTED]> wrote: > > > > I've tried to extend Element.Methods with my own new method. All works > > > perfectly under FF and Safari but IE6 says "Object doesn't support > > > this property or method" when I call this new method. > > > > Object.extend(Element.Methods, { > > > ownMethod: function(element) { > > > } > > > > }); > > > > Element.addMethods(); > > > > $('someDiv').ownMethod(); > > > > Is there any common solution ? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---