Using Prototype 1.6.0, I recently ran into IE7''s "Object does not support this property or method" error. After a quick search, I see the problem is usually caused by a DOM element that hasn''t been extended with Prototype''s Element.Methods. I don''t quite understand what was going on in my case and hoping someone can clue me in. The error was caused by the following line: $$(''#test-inspector form'').invoke("submit"); and I was able to fix the problem by changing it to this: $$(''#test-inspector form'')[0].submit(); I figured $$ would return elements that were properly extended. Is that not the case? Thank you, Denny Crall --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
$$ returns an array... your "error" version is trying to invoke "submit" on an array. I don''t think that''s what you want. Your fixed version looks better. On Wed, Jul 16, 2008 at 9:40 AM, Denny <dennis.crall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Using Prototype 1.6.0, I recently ran into IE7''s "Object does not > support this property or method" error. After a quick search, I see > the problem is usually caused by a DOM element that hasn''t been > extended with Prototype''s Element.Methods. I don''t quite understand > what was going on in my case and hoping someone can clue me in. > > The error was caused by the following line: > > $$(''#test-inspector form'').invoke("submit"); > > and I was able to fix the problem by changing it to this: > > $$(''#test-inspector form'')[0].submit(); > > I figured $$ would return elements that were properly extended. Is > that not the case? > > Thank you, > > Denny Crall > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You could also do $(''test-inspector'').down(''form'').submit() On Wed, Jul 16, 2008 at 9:44 AM, Andrew Kaspick <akaspick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> $$ returns an array... your "error" version is trying to invoke > "submit" on an array. I don''t think that''s what you want. Your fixed > version looks better. > > On Wed, Jul 16, 2008 at 9:40 AM, Denny <dennis.crall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> Using Prototype 1.6.0, I recently ran into IE7''s "Object does not >> support this property or method" error. After a quick search, I see >> the problem is usually caused by a DOM element that hasn''t been >> extended with Prototype''s Element.Methods. I don''t quite understand >> what was going on in my case and hoping someone can clue me in. >> >> The error was caused by the following line: >> >> $$(''#test-inspector form'').invoke("submit"); >> >> and I was able to fix the problem by changing it to this: >> >> $$(''#test-inspector form'')[0].submit(); >> >> I figured $$ would return elements that were properly extended. Is >> that not the case? >> >> Thank you, >> >> Denny Crall >> >> >> >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Enumberable.invoke() invokes a method for each element in a collection. In my case, there will always be exactly one element returned. The original line was working fine in every browser except IE, and from my understanding should be correct. Thanks for your feedback. On Jul 16, 9:44 am, "Andrew Kaspick" <akasp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> $$ returns an array... your "error" version is trying to invoke > "submit" on an array. I don''t think that''s what you want. Your fixed > version looks better. > > On Wed, Jul 16, 2008 at 9:40 AM, Denny <dennis.cr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Using Prototype 1.6.0, I recently ran into IE7''s "Object does not > > support this property or method" error. After a quick search, I see > > the problem is usually caused by a DOM element that hasn''t been > > extended with Prototype''s Element.Methods. I don''t quite understand > > what was going on in my case and hoping someone can clue me in. > > > The error was caused by the following line: > > > $$(''#test-inspector form'').invoke("submit"); > > > and I was able to fix the problem by changing it to this: > > > $$(''#test-inspector form'')[0].submit(); > > > I figured $$ would return elements that were properly extended. Is > > that not the case? > > > Thank you, > > > Denny Crall--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Oh, well if that''s what invoke is supposed to do on an Enumerable(Array) then I''m not sure why the error was occurring. So yes, I would think it would be correct as well then. On Wed, Jul 16, 2008 at 10:11 AM, Denny <dennis.crall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Enumberable.invoke() invokes a method for each element in a > collection. In my case, there will always be exactly one element > returned. The original line was working fine in every browser except > IE, and from my understanding should be correct. > > Thanks for your feedback. > > On Jul 16, 9:44 am, "Andrew Kaspick" <akasp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> $$ returns an array... your "error" version is trying to invoke >> "submit" on an array. I don''t think that''s what you want. Your fixed >> version looks better. >> >> On Wed, Jul 16, 2008 at 9:40 AM, Denny <dennis.cr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> > Using Prototype 1.6.0, I recently ran into IE7''s "Object does not >> > support this property or method" error. After a quick search, I see >> > the problem is usually caused by a DOM element that hasn''t been >> > extended with Prototype''s Element.Methods. I don''t quite understand >> > what was going on in my case and hoping someone can clue me in. >> >> > The error was caused by the following line: >> >> > $$(''#test-inspector form'').invoke("submit"); >> >> > and I was able to fix the problem by changing it to this: >> >> > $$(''#test-inspector form'')[0].submit(); >> >> > I figured $$ would return elements that were properly extended. Is >> > that not the case? >> >> > Thank you, >> >> > Denny Crall > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---