Hello, I''m using Prototype''s ''DOM walking'' functionality (Element.up(), Element.down()). It works fine in Firefox, but not in IE. I''m using Firefox 2.0 for development, and just tested my script within IE5, IE5.5, and IE6, all failing with the same message ("this object doesn''t support this method."). Source code example: HTML: <tr id=''row1''><td>test</td></tr> JavaScript: var td = $(''row1'').down(); //works in Firefox, not in IE //current workaround for IE, but unhandy: var td = getChildNode($(''row1''); function getChildNode(node) { if(node.firstChild.nodeType == 3) //textNode return node.childNodes[1]; else return node.firstChild; } Any help? Regards, Felix --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-20 14:01 UTC
Re: Element.down() / up() (DOM walking) doesn''t work in IE
Hey there, Felix a écrit :> HTML: > <tr id=''row1''><td>test</td></tr> > > JavaScript: > var td = $(''row1'').down(); //works in Firefox, not in IEOK, definitely an issue, as such simple calls provably work on IE6 (at least), due to their unit testing on MSIE before release. AAMOF, I just tried using the latest stable version (1.5.0), on MSIE 6 (XP SP2), and it works like a charm. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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
2007-Mar-20 20:52 UTC
Re: Element.down() / up() (DOM walking) doesn''t work in IE
While not related, probably a good place to bring this up... I had a few strange up/down issues with table rows and removing them but mostly because IE implicitly declared the TBody and based on this example, it looks like that doesn''t affect you. It was weird, if I went tableObj.down(1) i got TR (instead of the implicit tbody) but I couldn''t remove the TR, I had to remove it from the TBody which I couldn''t actually select. I ended up putting a physical TBody in and assigning an ID to it instead of the table- then everything worked as expected. I was testing in IE6 in this case. I know the TBody is added by IE but I thought it would also be in the dom, unless there is a workaround to ignore it in prototypejs.. Gareth On 3/21/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > > Felix a écrit : > > HTML: > > <tr id=''row1''><td>test</td></tr> > > > > JavaScript: > > var td = $(''row1'').down(); //works in Firefox, not in IE > > OK, definitely an issue, as such simple calls provably work on IE6 (at > least), due to their unit testing on MSIE before release. AAMOF, I just > tried using the latest stable version (1.5.0), on MSIE 6 (XP SP2), and > it works like a charm. > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mar 21, 6:52 am, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> While not related, probably a good place to bring this up... > > I had a few strange up/down issues with table rows and removing them but > mostly because IE implicitly declared the TBodyALL (standards compliant) browsers will add a tbody element to tables if there isn''t one in the source markup. I would expect table.down to return a table section element (most likely a tbody or thead). If it does otherwise, I''d consider it a bug. and based on this example,> it looks like that doesn''t affect you. > It was weird, if I went tableObj.down(1) i got TR (instead of the implicit > tbody) but I couldn''t remove the TR, I had to remove it from the TBody which > I couldn''t actually select.If you want the first row of a table and to ignore table section elements, use: table.rows[0];> I ended up putting a physical TBody in and assigning an ID to it instead of > the table- then everything worked as expected. > I was testing in IE6 in this case. > I know the TBody is added by IE but I thought it would also be in the dom,It''s in all browser DOMs, not just IE''s. -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---