I have this script: <script> function showDiv() { var divs = $$("div[extra]"); alert(divs[0].innerHTML); } </script> and these div''s: <div extra="1">This div has extra attribute</div> <div>This div does not have extra attribute</div> The script works fine in IE7 and Firefox. If I change the first line to: var divs = $$("[extra]"); the script works fine in Firefox but does not work in IE - no elements are returned into var divs. I guess this is a bug? Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try $$(*[extra]''). Note the ''*''. TAG On Jun 7, 2007, at 6:38 AM, Peter wrote:> > I have this script: > <script> > function showDiv() { > var divs = $$("div[extra]"); > alert(divs[0].innerHTML); > } > </script> > and these div''s: > > <div extra="1">This div has extra attribute</div> > <div>This div does not have extra attribute</div> > > The script works fine in IE7 and Firefox. If I change the first line > to: > var divs = $$("[extra]"); > the script works fine in Firefox but does not work in IE - no elements > are returned into var divs. I guess this is > a bug? > > Peter > > > >--~--~---------~--~----~------------~-------~--~----~ 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 Jun 7, 4:09 pm, Tom Gregory <t...-PGZyUNKar/Q@public.gmane.org> wrote:> Try $$(*[extra]''). Note the ''*''.Absolutely ...my bad. I checked my crib book and it seems that [attribute] is NOT a correct selector but only X[attribute]. So IE cannot be blamed for not working. Thanks - Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Peter wrote:> On Jun 7, 4:09 pm, Tom Gregory <t...-PGZyUNKar/Q@public.gmane.org> wrote: >> Try $$(*[extra]''). Note the ''*''. > Absolutely ...my bad.Not really.> I checked my crib book and it seems that [attribute] is NOT a correct > selector but only X[attribute].CSS2.1 [1] (CSS3 [2] too) states that the universal selector [2] may be omitted when it "is not the only component of a simple selector", which applies for attribute selectors.> So IE cannot be blamed for not working.Latest version of IE (7) claims CSS2.1 selectors support [3], so it can be blamed. [1] http://www.w3.org/TR/2006/WD-CSS21-20061106/selector.html#universal-selector [2] http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#universal-selector [3] http://www.microsoft.com/windows/products/winfamily/ie/features.mspx - -- Marius Feraru -----BEGIN PGP SIGNATURE----- iD8DBQFGaIo8tZHp/AYZiNkRAt0iAJ9T3mYJ6YJwiAwUNHi/ugZQeltYRwCeIVki EBXQaGGxh7F0bq3nLN41PaA=e0/T -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Latest version of IE (7) claims CSS2.1 selectors support [3], so it can be > blamed. > > [1]http://www.w3.org/TR/2006/WD-CSS21-20061106/selector.html#universal-s... > [2]http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#universal-selector > [3]http://www.microsoft.com/windows/products/winfamily/ie/features.mspx >Oh good, Predjudice Regained Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---