Hi, i need some help :) Does anywhere exists a fix for a code (scheme) like this: ---------------- var blas = document.getElementsByClassName( ''foo-class'', ''foo-id'' ); blas.each ( function( bla ) { var subbla = Element.childrenWithClassName( bla, ''subbla-class'', true ); } ); -------------- This scheme worked well till script.aculo v1.6.4 Since v1.6.5 I''ll receive this error message: "Element.childrenWithClassName is not a function" How can/must I rewrite the code? best wishes ps. sorry for my english, I''m posting from germany with a very old school english. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
chubaka wrote:> ... > > ---------------- > var blas = document.getElementsByClassName( ''foo-class'', ''foo-id'' ); > blas.each > ( > function( bla ) > { > var subbla = Element.childrenWithClassName( bla, ''subbla-class'', > true ); > } > ); > -------------- > > > This scheme worked well till script.aculo v1.6.4 > Since v1.6.5 I''ll receive this error message: > > "Element.childrenWithClassName is not a function" > > How can/must I rewrite the code?The method getElementsByClassName() is now available to any node: var blas = $(''foo-id'').getElementsByClassName(''foo-class''); blas.each(function( bla ) { var subbla = bla.getElementsByClassName(''subbla-class''); }); Regards, Ken Snyder --~--~---------~--~----~------------~-------~--~----~ 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 chubaka wrote:> Hi, > > i need some help :) > > Does anywhere exists a fix for a code (scheme) like this: > > ---------------- > var blas = document.getElementsByClassName( ''foo-class'', ''foo-id'' ); > blas.each > ( > function( bla ) > { > var subbla = Element.childrenWithClassName( bla, ''subbla-class'', > true ); > } > ); > -------------- > How can/must I rewrite the code?$$(''#foo-id .foo-class > .subbla-class'') ^ all ".subbla-class" children of any ".foo-class" element that is a descendant of "#foo-id" ;-) - -- Marius Feraru -----BEGIN PGP SIGNATURE----- iD8DBQFF17BhtZHp/AYZiNkRAta2AKDH7GdAUKU93SFSqemzmmzeFd+vBgCgz3A+ vhc+LwDEdWGyJ3EqKGGyEuw=yEf+ -----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 -~----------~----~----~----~------~----~------~--~---
Marius Feraru a écrit :> $$(''#foo-id .foo-class > .subbla-class'')Except $$ in 1.5.0 does not yet implement >... You''ll have to wait for its rewrite to be released. -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Christophe Porteneuve wrote:> Marius Feraru a écrit : >> $$(''#foo-id .foo-class > .subbla-class'') > Except $$ in 1.5.0 does not yet implement >... You''ll have to wait for > its rewrite to be released.Uh-oh, OK, OK :)) Then I guess he will have to settle to: $$(''#foo-id .foo-class'').invoke(''immediateDescendants'').flatten().findAll( function(el){ return el.hasClassName(''subbla-class'') } ); ugly ;-) - -- Marius Feraru -----BEGIN PGP SIGNATURE----- iD8DBQFF2JujtZHp/AYZiNkRAmDXAKC5zDafUIuzvswjRo4YEMUAnRmYBgCcCTou tq/UDWQmm3qjJxs+MgRdWyA=sFMU -----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 -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- RE: document.getElementsByClassName (prototype) andElement.childrenWithClassName (scriptaculous) redundancy?
- document.getElementsByClassName (prototype) and Element.childrenWithClassName (scriptaculous) redundancy?
- Questions about Sortable javascript
- Extending Element with getTop, getWidth, getLeft problem
- Limiting getElementsByClassName to specific nodes and entities