As I was combing through the API yesterday, I saw a HUGE surprise
ELEMENT IS A CONSTRUCTOR!! HIP HIP - HOOORAY!
Just what we needed!
Now, there was something I didn't understand. Can you append a newly
created html element
// fancy_input = new Element('input', {yada:'yada'... }) //
to an existing element
// $('my_test_form_thingie').insert( bottom: fancy_input ); //
(is element.appendChild() called internally)
Also, can I chain stuff like this:
[A] $('my_test_form_thingie').insert( bottom: fancy_input, bottom:
'<br /> This thing I inserted above is a fancy input. Prototype I love
you. Marry me!' );
OR must I use
[B] $('my_test_form_thingie').insert( bottom:
fancy_input).insert(bottom: '<br /> This thing I inserted above is a
fancy input. I like chaining.. boohoo.. :(' );
Cheers!
On Dec 6, 4:17 pm, themire <[EMAIL PROTECTED]> wrote:
> Agreed. They don't explain what keywords to use for at the top, etc.
>
> On Nov 21, 12:17 pm, LexNonScripta <[EMAIL PROTECTED]> wrote:
>
> > I must say that I was quite surprised to see the Prototype
> > documentation being so unclear about theElement.insertfunction
> > (http://www.prototypejs.org/api/element/insert).
>
> > I tried testing it, but I could not make any sense of it. Where does
> > the "position" of theinsertgo as an argument.
>
> > I would really appreciate a clear example.
>
> > Tnx,
>
> > DizyArt
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---