UPDATE
I think I have to be a little more precise.
I have this long running code that adds content to my DIVs. This is an example of the code:
m = jQuery('#test').clone();
//do some work
jQuery('#test2').append(m);
The Problem is that this can really take a while because sometimes I am adding 100 items. And the content only appears on the page after all 100 items have been added. So the user had to wait like 30 seconds or so.
What I would like to is to update the #test2 - DIV after adding 10 elements or so and then continue adding elements
Is there a way to refresh the DOM or (better) refresh the test2 - DIV and then continue adding Elements ?
OLD Description
I have a long running jQuery method that clones DIVs and appends them to the page. It looks like this:
m = jQuery('#test').clone();
//do some work
jQuery('#test2').append(m);
This code is called several times (sometimes up to 100 times) and it takes pretty long for the content to appear in the page.
Is there a way to refresh the dom and print the content onto the page so that the user is not getting bored because nothing happens ?