title: replace content of div without changing size or scrolling
body: <p>I'm trying to write some code which replaces old content with a placeholder while new content is loaded (via ajax).</p>
  
  <pre><code>&lt;div id="target"&gt;
  ...
  &lt;/div&gt;
  </code></pre>
  
  <p>During the ajax request-response cycle, i'd like to replace the content of the target div with a 'loading' message or image.</p>
  
  <p>So far, this is simple ...</p>
  
  <p>However in some cases the target is small, and others the target is large. In neither case do I want the target div's size to change or scrollbars to appear. if the loading message or image needs to be clipped so be it.</p>
  
  <p>The signature (id, class, style) of the 'target' div must remain the same throughout the process and I cannot set a width+height on the target div.</p>
  
  <p>i do not want to rely on additional code being executed when the new content is received.</p>
  
  <p>how would you approach this, using basic javascript/dhtml and/or prototype-js only.</p>
  
  <p>thanks, p.</p>