DOM latency

Discussion in 'Javascript' started by Darko, Feb 26, 2007.

  1. Darko

    Darko Guest

    Hi,

    I have a problem that seems to be related to DOM latency in executing
    instructions. How I see the situation, if one line of code produces a
    lot of inner instructions, then the engine is slowly executing them
    while allowing the following lines of code to be executed as well.

    I had similar problems earlier when I tried to put elements into an
    existing container on the page, rendering the new elements on the fly.
    I solved the problem by first generating the whole container in memory
    and then inserting it into a document subtree. But now I have the same
    problem, which can be seen in the following pseudo code:

    // GENERATE A BIG OBJECT IN MEMORY
    // RESTRUCTURE THE BIG OBJECT BY REARRANGING ITS (BIG) SUBOBJECTS
    // USE THE BIG OBJECT IN RENDERING THE PAGE

    It seems that restructuring the big object doesn't finish before its
    elements are used in the next phase, rendering the page, and what we
    get is partially correct data on the page, and partially the data from
    previous data order in the object. I tried to prove to myself that
    this is what is happening, by making a slight time delay between the
    second and the third phase in the above pseudo-code, e.g. 1 sec., and
    it seems to be working - all the data on the page is correctly
    displayed.

    Now my question is: if this is true, and the mechanism works as I
    described it, how do I correct the code? I don't think there's some
    way of "flushing" the instructions to make sure they're all completely
    executed, but maybe there is? Do you have some other way of solving
    the problem, or do you have an advice for avoiding it?

    Thank you for any answer or idea,

    Darko
     
    Darko, Feb 26, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?YWdlaG0=?=
    Replies:
    0
    Views:
    350
    =?Utf-8?B?YWdlaG0=?=
    Sep 20, 2004
  2. Replies:
    0
    Views:
    491
  3. Replies:
    5
    Views:
    408
  4. Dave
    Replies:
    1
    Views:
    6,186
    David White
    Jan 28, 2004
  5. Darko

    DOM latency

    Darko, Feb 26, 2007, in forum: Javascript
    Replies:
    8
    Views:
    110
    Darko
    Feb 27, 2007
Loading...

Share This Page