Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ydn-javascript] Re: create(d)Element not responding to javascript control

Expand Messages
  • Matt Warden
    ... Let s say you wish to inject the DOM equivalent of this: hi man You could: create the UL element insert the created UL element
    Message 1 of 5 , Sep 7, 2006
      On 9/7/06, Chris <loony2nz@...> wrote:
      > Matt,
      >
      > Thank you for your insight. It helped alot. I've fixed the rollup
      > function on the newly created panel due to you.
      >
      > However, I'm confused at to what you mean by "create the entire tree
      > node first then inject it". Can you elaborate on this a bit?

      Let's say you wish to inject the DOM equivalent of this:

      <ul>
      <li>hi</li>
      <li>man</li>
      </ul>

      You could:

      create the UL element
      insert the created UL element into the DOM
      create a LI element
      insert the LI element into the DOM under the created UL element
      create a text node
      insert the text node under the LI element just created
      create a LI element
      insert the LI element into the DOM under the created UL element
      create a text node
      insert the text node under the LI element just created

      This has much poorer performance compared to something like:


      create the LI
      create the text node
      append the text node
      create the UL
      append the LI to the UL
      create the second LI
      create the second text node
      append the second text node
      append the second LI to the UL
      *then* append the UL to the DOM

      Make sense?

      --
      Matt Warden
      Cleveland, OH, USA
      http://mattwarden.com


      This email proudly and graciously contributes to entropy.
    Your message has been successfully submitted and would be delivered to recipients shortly.