One way to avoid flickering is called double buffering. In Ajax, this can be done simply with two divs occupying the same space, one of which has the style of "display: none", the other "display: inline". Always write to invisible, and then change the display styles. If divs have absolute positioning and size, there is absolutely no chance of flickering, and even if they do not, you can hardly do better.
source share