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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
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 <moca...-S7FoVGKkKTI@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
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 <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <moca...-S7FoVGKkKTI@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
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 <moca...-S7FoVGKkKTI@public.gmane.org> 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 <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <moca...-S7FoVGKkKTI@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
And what is the body of ownMethod? On Sun, Jun 29, 2008 at 3:06 PM, kangax <kangax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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 <moca...-S7FoVGKkKTI@public.gmane.org> 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 <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <moca...-S7FoVGKkKTI@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I have the same pb with getDimensions() : Example : $(''elt'').getDimensions() It works in FF but in IE : "Object doesn''t support this property or method"; Finally i used native clientWidth and clientHeight :( :( :( --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
There were some changes to #getDimensions in recent commits. Could you check if trunk version works properly? -- kangax On Jul 10, 10:46 am, rachid <r.bahass...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have the same pb with getDimensions() : > Example : > > $(''elt'').getDimensions() > > It works in FF but in IE : "Object doesn''t support this property or > method"; > > Finally i used native clientWidth and clientHeight :( :( :(--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
The pb does not come from getDimensions. I ''ve tried to alert all of my element methods in IE doing this : alert($H( $(''elt'') ).inspect()) Result : ==> In FF the alert show me all prototypejs Element.methods ==> In IE the alert show me only native javascript attributes and methods Element seems have no prototypejs methods. Maybe the Element.addMethods bugs ??? On 10 juil, 16:57, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> There were some changes to #getDimensions in recent commits. Could you > check if trunk version works properly? > > -- kangax > > On Jul 10, 10:46 am, rachid <r.bahass...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have the same pb with getDimensions() : > > Example : > > > $(''elt'').getDimensions() > > > It works in FF but in IE : "Object doesn''t support this property or > > method"; > > > Finally i used native clientWidth and clientHeight :( :( :(--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
i ve added the screenshots of alerts ( alert($H( $ (''elt'') ).inspect()) ) ON IE : http://groups.google.com/group/rubyonrails-spinoffs/web/ie%20alert%20elements%20methods.jpg ON FF http://groups.google.com/group/rubyonrails-spinoffs/web/ff%20alert%20elements%20methods.jpg --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
What version of IE are you using. Prototype supports IE 6+ Is your Element ID unique? Is it an html element and not an xml node? Is it an ID and not a name attribute? Are you calling this after the dom has loaded? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
1 - I tried it on IE 6 and IE 7, same alert on both and same error. 2 - My ID is unique, i only have a same element class like this: <div id="search"> <div class="search"> </div> </div> ==> But i already tried to rename the id "search" by "foo" or "bar" >> same error 3 - Like you can see it''s a <div> node and not XML 4 - It is an ID and not a name... lol 5 - I tried to call it in 2 way : a - Event.observe(window, ''load'', go_search, false); b - <a onclick="go_search()" href="#">search</a> Then DOM is loaded 6 - Finally i use prototype 1.6.0.2 Nothing to do.... I m still searching.... THX On 10 juil, 19:09, jdalton <John.David.Dal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What version of IE are you using. > Prototype supports IE 6+ > > Is your Element ID unique? > Is it an html element and not an xml node? > Is it an ID and not a name attribute? > Are you calling this after the dom has loaded?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I answer myself for those who will have this pb, there are two solutions when this error occurs in ie 6 or ie 7 : 1 - you say fuck prototype and you usie native javascript methods : ==> elt.setStyle({foo:bar}) <<>> elt.style.foo="bar" ==> elt.getDimensions().height <<>> elt.clientHeight (warning with this there are differences between FF and IE) 2 - you absolutely want to use prototype, so you put your element in a $$ method and magic happens! In My example : ==> $(''search'').getDimensions().height return an error "Object doesn''t support this property or method" And with the magic method IE is happy : ==> $$(''#search'')[0].getDimensions().height; GREAT! .... By searching more , i found it''s not so magic. $$ add methods to elements... For those who have IE DEVELOPER TOOLBAR, you can make a test by inspecting an HTML ELEMENT that was called by $$, very nice :D :D :D :D --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
here''s my screenshots about my div element that has all the prototype methods as attributes : http://rubyonrails-spinoffs.googlegroups.com/web/ie%20developer%20toolbar%20div%20prototype%20method.jpg?gsc=M1GLeRYAAAB1z1bqtwE3VkDwdpHqENu5vmqfzrIRh74LnVxB_8J-NQ --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
If $$(''#foo'')[0] !== $(''foo'') then it is definitely a bug. Could you please file it? -- kangax On Jul 11, 10:44 am, rachid <r.bahass...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> here''s my screenshots about my div element that has all the prototype > methods as attributes :http://rubyonrails-spinoffs.googlegroups.com/web/ie%20developer%20too...--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
$$(''#foo'')[0] is not always $(''foo''). We developped a project with more than 200 pages. And this bug appear only in 2 pages (with the same javascript). I''ll file it when i''ll find its origin. On 11 juil, 23:54, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If $$(''#foo'')[0] !== $(''foo'') then it is definitely a bug. Could you > please file it? > > -- kangax > > On Jul 11, 10:44 am, rachid <r.bahass...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > here''s my screenshots about my div element that has all the prototype > > methods as attributes :http://rubyonrails-spinoffs.googlegroups.com/web/ie%20developer%20too...--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---