Hi all: getElementsBySelector appears to be broken in 1.5 final on IE. getElementsBySelector works as expected in FF 1.5 final and also it works correctly in IE in 1.5 RC2. Here''s my simple code fragment: var els = element.getElementsBySelector(''[recnum]''); The variable els is undefined in 1.5 final on IE. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, Thanks for the report. Could you kindly post a sample of your HTML so we can see what''s going wrong? Regards, Tobie Langel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tobie, I have a difficulty simplifing my code :) The problem I think is that the buildMatchExpression method in 1.5 final generates ''hasAttribute, which is not supported in IE. See the difference btwn RC2 and 1.5 final below: 1.5 RC2: case undefined: conditions.push(value + '' != null''); break; 1.5 final case undefined: conditions.push(''element.hasAttribute('' + attribute.name.inspect() + '')''); break; --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Les, We''ve added support for hasAttribute in IE (http://prototypejs.org/api/element/methods/simulated), so this shouldn''t be the issue. I''d just need to have a look at the HTML snippet where ''recnum'' is specified. What does it look like? Best, Tobie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Actually Les, You''re just missing a universal selector (see here for details on the syntax: http://www.w3.org/TR/css3-selectors/#sequence). This should work: var els = element.getElementsBySelector(''*[recnum]''); I''m sorry I didn''t notice that earlier. Regards, Tobie --~--~---------~--~----~------------~-------~--~----~ 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 1/24/07, tobie <tobie.langel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> We''ve added support for hasAttribute in IE > (http://prototypejs.org/api/element/methods/simulated), so this > shouldn''t be the issue.But do all Elements $$ touches in its tests get extended to provide it? Bye, Martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> But do all Elements $$ touches in its tests get extended to provide it?yep, check line 1820 of v. 1.5.0 I think the issue is in how you have specified your selector (as I mentioned in my last comment). Doesn''t adding the universal selector make it work? Best, Tobie --~--~---------~--~----~------------~-------~--~----~ 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 1/24/07, tobie <tobie.langel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I think the issue is in how you have specified your selector (as I > mentioned in my last comment). > > Doesn''t adding the universal selector make it work?I can''t say, I am not the OP :-) It is just strange that the selector would work in Firefox, but not in IE. Bye, Martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Guys, thank you for your responses. I found out what the problem is, see the code fragment below. I used the _extended attribute on one of the divs... If I changed the attribute to anything else, the the alert would correctly displays 2 as the number of elements with the recnum attribute. Turns out Prototype uses the _extended attribute internally in IE. BTW prepending the universal selector had no impact. <html> <head> <script type="text/javascript" src="/w2gi/javascript/prototype.js"></script> <script> function init() { alert($(''panel'').getElementsBySelector(''*[recnum]'').length) } </script> </head> <body onload="init();"> <div id="panel"> <TABLE> <TBODY> <TR> <TD> <DIV _extended="true" templateid="default"> <DIV> <DIV recnum="1">1</DIV> </DIV> </DIV> </TD> <TD> <A href="#" recnum="1">Link</A> </TD> </TR> </TBODY> </TABLE> </div> </body> </html> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Great, Happy to hear that it a solved issue now. As a sidenote, this kind of namespacing issue just hasn''t really been solved yet. Sometimes I wonder if we should not go for the really verbose in such cases: element._extended_by_prototype or something of the like. Cheers, Tobie On 24 janv. 2007, at 10:07, Les wrote:> > Guys, thank you for your responses. I found out what the problem is, > see the code fragment below. > > I used the _extended attribute on one of the divs... If I changed the > attribute to anything else, the the alert would correctly displays > 2 as > the number of elements with the recnum attribute. Turns out Prototype > uses the _extended attribute internally in IE. > > BTW prepending the universal selector had no impact. > > <html> > <head> > <script type="text/javascript" > src="/w2gi/javascript/prototype.js"></script> > <script> > function init() { > > alert($(''panel'').getElementsBySelector(''*[recnum]'').length) > > } > </script> > </head> > <body onload="init();"> > <div id="panel"> > <TABLE> > <TBODY> > <TR> > <TD> > <DIV _extended="true" > templateid="default"> > <DIV> > <DIV recnum="1">1</DIV> > </DIV> > </DIV> > </TD> > <TD> > <A href="#" recnum="1">Link</A> > </TD> > </TR> > </TBODY> > </TABLE> > </div> > </body> > </html> > > > >--~--~---------~--~----~------------~-------~--~----~ 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 1/24/07, Tobie Langel <tobie.langel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Sometimes I wonder if we should not go for the really verbose in such > cases: > > element._extended_by_prototype > > or something of the like.It cannot hurt to be a bit more defensive with a one-time change. If you grep for "element._", you will find some more expando properties used. How about element._prototypejs_extended, element._prototypejs_overflow etc. Bye, Martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> It cannot hurt to be a bit more defensive with a one-time change. If > you grep for "element._", you will find some more expando properties > used.I know...> How about element._prototypejs_extended, element._prototypejs_overflow etc.Actually, I agree. Do you feel like posting a patch? Best, Tobie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---