If it were a wiki, I would edit this myself, but it''s not. The documentation for Element.insert at: http://www.prototypejs.org/api/element/insert Is not clear enough when it comes to indicating how to position content. It says, "Inserts content before, after, at the top of, or at the bottom of element, as specified by the position property of the second argument." It would be helpful to show that you specify positions like: position: Insertion.Bottom As is displayed here: http://www.prototypejs.org/api/insertion Currently it is too easy to spend time trying things like: $(''messages'').insert(transport.responseText, {position: bottom}); Which does not work. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Your copied text is lacking the code syntax from the page, but "position" is a keyword and is to be replaced by the position you desire. Here are some examples: $(''foo'').insert( { top: ''<p>Hello</p>'' } ) $(''foo'').insert( { bottom: ''<p>Hello</p>'' } ) $(''foo'').insert( { before: ''<p>Hello</p>'' } ) $(''foo'').insert( { after: ''<p>Hello</p>'' } ) The second example, bottom, can also be written as: $(''foo'').insert( ''<p>Hello</p>'' ) -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for the great tip. It''s precisely the sort of thing that should probably be listed in the documentation, as currently, I do think it is a bit lacking. On Mar 26, 3:27 pm, "Justin Perkins" <justinperk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Your copied text is lacking the code syntax from the page, but > "position" is a keyword and is to be replaced by the position you > desire. Here are some examples: > > $(''foo'').insert( { top: ''<p>Hello</p>'' } ) > $(''foo'').insert( { bottom: ''<p>Hello</p>'' } ) > $(''foo'').insert( { before: ''<p>Hello</p>'' } ) > $(''foo'').insert( { after: ''<p>Hello</p>'' } ) > > The second example, bottom, can also be written as: $(''foo'').insert( > ''<p>Hello</p>'' ) > > -justin--~--~---------~--~----~------------~-------~--~----~ 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 Wed, Mar 26, 2008 at 2:43 PM, adriand <adrianduyzer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > as currently, I do > think it is a bit lacking.It''s lacking from a "new to prototype" sense, but once you''re familiar with prototype I think you''ll find that the site is a wonderful resource. I do agree that it (that sentence) is a little difficult to read, and without an example it''s pretty open to your own interpretation. Maybe there is plans to add some examples or make these docs more readable and less of "you need to be an advanced prototype person to use this page" kind of style. -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---