Is there something special about the use of the method name "metadata"? For example: Element.addMethods({ metadata: function() { alert("foo") } }); $("my_id").metadata(); The above pops up an alert dialog as expected in Firefox and Safari; gives the error "Object doesn''t support this property or method" in IE7; and does nothing at all in IE6. However, simply renaming "metadata" to something else (such as "mymetadata") makes it work! What is it about the method name "metadata" in Internet Explorer? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jonas Rosenqvist
2008-Feb-26 15:42 UTC
Re: Method name "metadata" in IE via Elements.addMethods()
Works fine for me in ie 7 vista and ie 6 xp, although that bloated dinosaur reserves half the dictionary metadata doesnt seem to be a problem, you must have it defined somewhere else. <div id="my_id"></div> <script type="text/javascript"> Element.addMethods({ metadata: function() { alert("foo") } }); $("my_id").metadata(); </script> On 25 Feb, 23:56, Cliff <cliffor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is there something special about the use of the method name > "metadata"? For example: > > Element.addMethods({ > metadata: function() { alert("foo") } > > }); > > $("my_id").metadata(); > > The above pops up an alert dialog as expected in Firefox and Safari; > gives the error "Object doesn''t support this property or method" in > IE7; and does nothing at all in IE6. However, simply renaming > "metadata" to something else (such as "mymetadata") makes it work! > What is it about the method name "metadata" in Internet Explorer?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for checking. It turns out the problem is that I am using a non- standard attribute named "metadata" on the element in question, like so: <div id="my_id" metadata="stuff"></div> It looks like IE adds a property to the element named after the attribute. So, when I try to call my added method named metadata, IE instead looks at its own metadata property. I guess I''ll just change the attribute name. Of course, you would have no way of knowing that was my problem since I didn''t include that info :) Cliff On Feb 26, 10:42 am, Jonas Rosenqvist <jon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Works fine for me in ie 7 vista and ie 6 xp, although that bloated > dinosaur reserves half the dictionary metadata doesnt seem to be a > problem, you must have it defined somewhere else. > > <div id="my_id"></div> > <script type="text/javascript"> > Element.addMethods({ > metadata: function() { alert("foo") } > > }); > > $("my_id").metadata(); > </script> > > On 25 Feb, 23:56, Cliff <cliffor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Is there something special about the use of the method name > > "metadata"? For example: > > > Element.addMethods({ > > metadata: function() { alert("foo") } > > > }); > > > $("my_id").metadata(); > > > The above pops up an alert dialog as expected in Firefox and Safari; > > gives the error "Object doesn''t support this property or method" in > > IE7; and does nothing at all in IE6. However, simply renaming > > "metadata" to something else (such as "mymetadata") makes it work! > > What is it about the method name "metadata" in Internet Explorer?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gareth Evans
2008-Feb-26 20:59 UTC
Re: Method name "metadata" in IE via Elements.addMethods()
I found that ''seperator'' behaved the same way - in Firefox; whats with that? On Wed, Feb 27, 2008 at 5:37 AM, Cliff <clifforama-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanks for checking. It turns out the problem is that I am using a non- > standard attribute named "metadata" on the element in question, like > so: > > <div id="my_id" metadata="stuff"></div> > > It looks like IE adds a property to the element named after the > attribute. So, when I try to call my added method named metadata, IE > instead looks at its own metadata property. I guess I''ll just change > the attribute name. > > Of course, you would have no way of knowing that was my problem since > I didn''t include that info :) > > Cliff > > > On Feb 26, 10:42 am, Jonas Rosenqvist <jon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Works fine for me in ie 7 vista and ie 6 xp, although that bloated > > dinosaur reserves half the dictionary metadata doesnt seem to be a > > problem, you must have it defined somewhere else. > > > > <div id="my_id"></div> > > <script type="text/javascript"> > > Element.addMethods({ > > metadata: function() { alert("foo") } > > > > }); > > > > $("my_id").metadata(); > > </script> > > > > On 25 Feb, 23:56, Cliff <cliffor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Is there something special about the use of the method name > > > "metadata"? For example: > > > > > Element.addMethods({ > > > metadata: function() { alert("foo") } > > > > > }); > > > > > $("my_id").metadata(); > > > > > The above pops up an alert dialog as expected in Firefox and Safari; > > > gives the error "Object doesn''t support this property or method" in > > > IE7; and does nothing at all in IE6. However, simply renaming > > > "metadata" to something else (such as "mymetadata") makes it work! > > > What is it about the method name "metadata" in Internet Explorer? > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Like Jonas suggests, make sure that "separator" isn''t defined anywhere else. Although, assuming the behaviour is isolated to Firefox, that seems unlikely. If your problem is at all like mine, check that you don''t have any attributes named "separator". Then again, if that were the case, it would be fine in Firefox, broken in IE. Still, can''t hurt to check. On Feb 26, 3:59 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I found that ''seperator'' behaved the same way - in Firefox; whats with that? > > On Wed, Feb 27, 2008 at 5:37 AM, Cliff <cliffor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks for checking. It turns out the problem is that I am using a non- > > standard attribute named "metadata" on the element in question, like > > so: > > > <div id="my_id" metadata="stuff"></div> > > > It looks like IE adds a property to the element named after the > > attribute. So, when I try to call my added method named metadata, IE > > instead looks at its own metadata property. I guess I''ll just change > > the attribute name. > > > Of course, you would have no way of knowing that was my problem since > > I didn''t include that info :) > > > Cliff > > > On Feb 26, 10:42 am, Jonas Rosenqvist <jon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Works fine for me in ie 7 vista and ie 6 xp, although that bloated > > > dinosaur reserves half the dictionary metadata doesnt seem to be a > > > problem, you must have it defined somewhere else. > > > > <div id="my_id"></div> > > > <script type="text/javascript"> > > > Element.addMethods({ > > > metadata: function() { alert("foo") } > > > > }); > > > > $("my_id").metadata(); > > > </script> > > > > On 25 Feb, 23:56, Cliff <cliffor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Is there something special about the use of the method name > > > > "metadata"? For example: > > > > > Element.addMethods({ > > > > metadata: function() { alert("foo") } > > > > > }); > > > > > $("my_id").metadata(); > > > > > The above pops up an alert dialog as expected in Firefox and Safari; > > > > gives the error "Object doesn''t support this property or method" in > > > > IE7; and does nothing at all in IE6. However, simply renaming > > > > "metadata" to something else (such as "mymetadata") makes it work! > > > > What is it about the method name "metadata" in Internet Explorer?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---