title: innerHTML manipulation in JavaScript
body: <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>