<p>I am developing a web page code, which fetches dynamically the content from the server and then places this content to container nodes using something like</p>

<pre><code>container.innerHTML = content;
</code></pre>

<p>Sometimes I have to overwrite some previous content in this node. This works fine, until it happens that previous content occupied more vertical space then a new one would occupy AND a user scrolled the page down -- scrolled more than new content would allow, provided its height.</p>

<p>In this case the page redraws incorrectly -- some artifacts of the old content remain. It works fine, and it is even possible to get rid of artifacts, by minimizing and restoring the browser (or force the window to be redrawn in an other way), however this does not seem very convenient.</p>

<p>I am testing this only under Safari (this is a iPhone-optimized website).</p>

<p>Does anybody have the idea how to deal with this?</p>

It sounds like you are having a problem with the browser itself.  Does this problem only occur in one browser?
One thing you might try is using a lightweight library like
jQuery
.  It handles browser differences fairly nicely.  To set the inner HTML for a div with the ID of
container
you would simply write this:
```
```
$('#container').html( content );
```
```
That will work in most browsers.  I do not know if it will fix your problem specifically or not but it may be worth a try.