$$(''.class-a'', ''.class-b'').each(function(single_element){ single_element = $(single_element); // can i remove this? }); t thought this was necessary in prototype 1.5... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
im think its not after doing some tests... but im still not 100% sure =] On 25 nov, 15:27, Roland <franssen.rol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> $$(''.class-a'', ''.class-b'').each(function(single_element){ > single_element = $(single_element); // can i remove this? > > }); > > t thought this was necessary in prototype 1.5...--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
$$ extends all elements it returns, so yes, you can remove it. Am 25.11.2007 um 15:29 schrieb Roland:> > im think its not after doing some tests... but im still not 100% sure > =] > > On 25 nov, 15:27, Roland <franssen.rol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> $$(''.class-a'', ''.class-b'').each(function(single_element){ >> single_element = $(single_element); // can i remove this? >> >> }); >> >> t thought this was necessary in prototype 1.5... > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
what if those elements weren''t dynamically drawn by prototype but are statically contained in HTML? are they extended then? On Nov 25, 2007 4:44 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote:> > $$ extends all elements it returns, so yes, you can remove it. > > Am 25.11.2007 um 15:29 schrieb Roland: > > > > > > im think its not after doing some tests... but im still not 100% sure > > =] > > > > On 25 nov, 15:27, Roland <franssen.rol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> $$(''.class-a'', ''.class-b'').each(function(single_element){ > >> single_element = $(single_element); // can i remove this? > >> > >> }); > >> > >> t thought this was necessary in prototype 1.5... > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I don''t understand what you mean. Please give an example. Am 25.11.2007 um 18:25 schrieb Deniz Adrian:> > what if those elements weren''t dynamically drawn by prototype but are > statically contained in HTML? are they extended then? > > On Nov 25, 2007 4:44 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: >> >> $$ extends all elements it returns, so yes, you can remove it. >> >> Am 25.11.2007 um 15:29 schrieb Roland: >> >> >>> >>> im think its not after doing some tests... but im still not 100% >>> sure >>> =] >>> >>> On 25 nov, 15:27, Roland <franssen.rol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> $$(''.class-a'', ''.class-b'').each(function(single_element){ >>>> single_element = $(single_element); // can i remove this? >>>> >>>> }); >>>> >>>> t thought this was necessary in prototype 1.5... >>>> >> >> >>> >> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If I undestand correctly, Deniz means elements that were already in the HTML code, not elements created by Prototype. If that is the question, then the answer is yes, they are extended. (BTW, elements created by Proto are *already* extended, so you don''t need to extend those, only those that are in the html, OR that were created with "normal" javascript -- ie, document.createElement) Best, -Nicolas On Nov 25, 2007 3:43 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote:> > I don''t understand what you mean. Please give an example. > > Am 25.11.2007 um 18:25 schrieb Deniz Adrian: > > > > > > what if those elements weren''t dynamically drawn by prototype but are > > statically contained in HTML? are they extended then? > > > > On Nov 25, 2007 4:44 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: > >> > >> $$ extends all elements it returns, so yes, you can remove it. > >> > >> Am 25.11.2007 um 15:29 schrieb Roland: > >> > >> > >>> > >>> im think its not after doing some tests... but im still not 100% > >>> sure > >>> =] > >>> > >>> On 25 nov, 15:27, Roland <franssen.rol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>>> $$(''.class-a'', ''.class-b'').each(function(single_element){ > >>>> single_element = $(single_element); // can i remove this? > >>>> > >>>> }); > >>>> > >>>> t thought this was necessary in prototype 1.5... > >>>> > >> > >> > >>> > >> > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
you got that 100% correctly, thanks ;-) On Nov 26, 2007 2:29 AM, Nicolás Sanguinetti <godfoca-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > If I undestand correctly, Deniz means elements that were already in > the HTML code, not elements created by Prototype. > If that is the question, then the answer is yes, they are extended. > (BTW, elements created by Proto are *already* extended, so you don''t > need to extend those, only those that are in the html, OR that were > created with "normal" javascript -- ie, document.createElement) > > Best, > -Nicolas > > > On Nov 25, 2007 3:43 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: > > > > I don''t understand what you mean. Please give an example. > > > > Am 25.11.2007 um 18:25 schrieb Deniz Adrian: > > > > > > > > > > what if those elements weren''t dynamically drawn by prototype but are > > > statically contained in HTML? are they extended then? > > > > > > On Nov 25, 2007 4:44 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: > > >> > > >> $$ extends all elements it returns, so yes, you can remove it. > > >> > > >> Am 25.11.2007 um 15:29 schrieb Roland: > > >> > > >> > > >>> > > >>> im think its not after doing some tests... but im still not 100% > > >>> sure > > >>> =] > > >>> > > >>> On 25 nov, 15:27, Roland <franssen.rol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>>> $$(''.class-a'', ''.class-b'').each(function(single_element){ > > >>>> single_element = $(single_element); // can i remove this? > > >>>> > > >>>> }); > > >>>> > > >>>> t thought this was necessary in prototype 1.5... > > >>>> > > >> > > >> > > >>> > > >> > > > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ah, ic. Anyway, $$ extends all elements it returns -- regardless if they where included in "static" HTML, created by setting .innerHTML, or using DOM methods to create them. :-) The same is true for all other Prototype methods that return elements, that is $ and all Element.xxx methods that return an element. Btw, here''s an article about how the extension mechanism works, for reference: http://prototypejs.org/learn/extensions Maybe we could extend that article to include more specific info on which Prototype methods are guaranteed to return extended elements. Best, Thomas Am 26.11.2007 um 11:12 schrieb Deniz Adrian:> > you got that 100% correctly, thanks ;-) > > On Nov 26, 2007 2:29 AM, Nicolás Sanguinetti <godfoca-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> >> If I undestand correctly, Deniz means elements that were already in >> the HTML code, not elements created by Prototype. >> If that is the question, then the answer is yes, they are extended. >> (BTW, elements created by Proto are *already* extended, so you don''t >> need to extend those, only those that are in the html, OR that were >> created with "normal" javascript -- ie, document.createElement) >> >> Best, >> -Nicolas >> >> >> On Nov 25, 2007 3:43 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: >>> >>> I don''t understand what you mean. Please give an example. >>> >>> Am 25.11.2007 um 18:25 schrieb Deniz Adrian: >>> >>> >>>> >>>> what if those elements weren''t dynamically drawn by prototype but >>>> are >>>> statically contained in HTML? are they extended then? >>>> >>>> On Nov 25, 2007 4:44 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: >>>>> >>>>> $$ extends all elements it returns, so yes, you can remove it. >>>>> >>>>> Am 25.11.2007 um 15:29 schrieb Roland: >>>>> >>>>> >>>>>> >>>>>> im think its not after doing some tests... but im still not 100% >>>>>> sure >>>>>> =] >>>>>> >>>>>> On 25 nov, 15:27, Roland <franssen.rol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>>>> $$(''.class-a'', ''.class-b'').each(function(single_element){ >>>>>>> single_element = $(single_element); // can i remove this? >>>>>>> >>>>>>> }); >>>>>>> >>>>>>> t thought this was necessary in prototype 1.5... >>>>>>> >>>>> >>>>> >>>>>> >>>>> >>>> >>>>> >>> >>> >>>> >>> >> >>> >> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I originally stumbled upon this having Internet Explorer versions returning unextended elements, and firefox returning extended ones... fixed if by $$ing it... ;-) On Nov 26, 2007 11:39 AM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote:> > Ah, ic. > > Anyway, $$ extends all elements it returns -- regardless if they where > included in "static" HTML, created by setting .innerHTML, or using DOM > methods to create them. :-) > > The same is true for all other Prototype methods that return elements, > that is $ and all Element.xxx methods that return an element. > > Btw, here''s an article about how the extension mechanism works, for > reference: > http://prototypejs.org/learn/extensions > > Maybe we could extend that article to include more specific info on > which Prototype methods are guaranteed to return extended elements. > > Best, > Thomas > > Am 26.11.2007 um 11:12 schrieb Deniz Adrian: > > > > > > you got that 100% correctly, thanks ;-) > > > > On Nov 26, 2007 2:29 AM, Nicolás Sanguinetti <godfoca-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > >> > >> If I undestand correctly, Deniz means elements that were already in > >> the HTML code, not elements created by Prototype. > >> If that is the question, then the answer is yes, they are extended. > >> (BTW, elements created by Proto are *already* extended, so you don''t > >> need to extend those, only those that are in the html, OR that were > >> created with "normal" javascript -- ie, document.createElement) > >> > >> Best, > >> -Nicolas > >> > >> > >> On Nov 25, 2007 3:43 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: > >>> > >>> I don''t understand what you mean. Please give an example. > >>> > >>> Am 25.11.2007 um 18:25 schrieb Deniz Adrian: > >>> > >>> > >>>> > >>>> what if those elements weren''t dynamically drawn by prototype but > >>>> are > >>>> statically contained in HTML? are they extended then? > >>>> > >>>> On Nov 25, 2007 4:44 PM, Thomas Fuchs <thomas-9D208sng4xU@public.gmane.org> wrote: > >>>>> > >>>>> $$ extends all elements it returns, so yes, you can remove it. > >>>>> > >>>>> Am 25.11.2007 um 15:29 schrieb Roland: > >>>>> > >>>>> > >>>>>> > >>>>>> im think its not after doing some tests... but im still not 100% > >>>>>> sure > >>>>>> =] > >>>>>> > >>>>>> On 25 nov, 15:27, Roland <franssen.rol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>>>>>> $$(''.class-a'', ''.class-b'').each(function(single_element){ > >>>>>>> single_element = $(single_element); // can i remove this? > >>>>>>> > >>>>>>> }); > >>>>>>> > >>>>>>> t thought this was necessary in prototype 1.5... > >>>>>>> > >>>>> > >>>>> > >>>>>> > >>>>> > >>>> > >>>>> > >>> > >>> > >>>> > >>> > >> > >>> > >> > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---