Hi i''m learning prototype and i need to know something... Someone knows how to write and get the value of some atribute... i mean like...jquery that uses $(''#sub-div'').atrr(''alt'',''visible); in prototype is there something like that?... I hope you can help me and thanks :D --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Zell, I''m fairly new to Prototype myself but I believe the syntax you''re looking for is: $(''tag'').readAttribute(''title''); http://www.prototypejs.org/api/element/readAttribute -William On Jul 5, 5:54 am, Zell <zel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi i''m learning prototype and i need to know something... > > Someone knows how to write and get the value of some atribute... i > mean like...jquery that uses $(''#sub-div'').atrr(''alt'',''visible); > > in prototype is there something like that?... > > I hope you can help me and thanks :D--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That would be: $(''sub-div'').writeAttribute({ alt: ''visible'' }); -- kangax On Jul 5, 12:54 am, Zell <zel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi i''m learning prototype and i need to know something... > > Someone knows how to write and get the value of some atribute... i > mean like...jquery that uses $(''#sub-div'').atrr(''alt'',''visible); > > in prototype is there something like that?... > > I hope you can help me and thanks :D--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
or: $(''sub-div'').writeAttribute(''alt'', ''visible''); On Jul 5, 7:13 pm, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That would be: > $(''sub-div'').writeAttribute({ alt: ''visible'' }); > > -- kangax > > On Jul 5, 12:54 am, Zell <zel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi i''m learning prototype and i need to know something... > > > Someone knows how to write and get the value of some atribute... i > > mean like...jquery that uses $(''#sub-div'').atrr(''alt'',''visible); > > > in prototype is there something like that?... > > > I hope you can help me and thanks :D--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey thanks!! it really helped me a lot!... One mor thing, have anyone knows...how to tell lik...$$ (''.class:visible'').not($(this).find(''div''); in prototype, i know that there is a function that is findElement(); but..i do not know if there''s something like the .not(); that has jquery... and i''m changin to prototype :D thanks a lot --~--~---------~--~----~------------~-------~--~----~ 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''m not sure what jQuery''s .find does, but you can use #reject to find all "hidden" elements (since prototype.js only supports "standard" selectors): $$(''.class'').reject(Element.visible) Note that since Element.visible only checks actual element''s style, it will skip any elements which have "hidden" parents. -- kangax On Jul 6, 12:13 am, Zell <zel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey thanks!! it really helped me a lot!... > > One mor thing, have anyone knows...how to tell lik...$$ > (''.class:visible'').not($(this).find(''div''); > > in prototype, i know that there is a function that is findElement(); > but..i do not know if there''s something like the .not(); that has > jquery... and i''m changin to prototype :D > > thanks a lot--~--~---------~--~----~------------~-------~--~----~ 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 initially threw me in jQuery was filter() vs. find(). filter() gets the *subset* of elements that match some selector, where find() gets the * children* of elements that match some selector. -Fred On Sun, Jul 6, 2008 at 11:33 AM, kangax <kangax-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m not sure what jQuery''s .find does, but you can use #reject to find > all "hidden" elements (since prototype.js only supports "standard" > selectors): > $$(''.class'').reject(Element.visible) > Note that since Element.visible only checks actual element''s style, it > will skip any elements which have "hidden" parents. > > -- kangax-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---