Javascript slowly "flush" DOM Tree
<p>I have really strange problem. I'm trying to get width and height of an image using following way:</p>

<ol>
<li>Create a image tag and add .src to it.</li>
<li>add this image tag to document.body.</li>
<li>making this image tag visible (display:inline).</li>
<li>getting .offsetWidth and .offsetHeight of element.</li>
<li>hidding image tag(display:none);</li>
</ol>

<p>all this is done using JS and it all work really well on my localhost, but when I uploaded a site to my client hosting provider I was amazed. offsetWidth and .offsetHeight was 0 in step 4. Why do that happen? I think that I need some kind of "flush" after step 3 before step 4, but I'm not exactly sure. Any suggestions ? Thank you.</p>
