JavaScript: Image doesn't scale in IE when dynamically added
<p>when I dynamically add an image to a div the image doesn't scale when you resize the window in Internet Explorer.</p>

<p>I think it's more clear if I show two really simple examples:</p>

<p>The following example doesn't use JavaScript it's just plain html and it does what I want.<br>
<a href="http://www.friendly-stranger.com/halp/ie-width/index.html" rel="nofollow">http://www.friendly-stranger.com/halp/ie-width/index.html</a></p>

<p>The next one uses JavaScript and if you resize the width of your browser window the image doesn't scale only the width gets smaller.<br>
<a href="http://www.friendly-stranger.com/halp/ie-width/bad.html" rel="nofollow">http://www.friendly-stranger.com/halp/ie-width/bad.html</a></p>

<p>This is a screenshot of both examples:
<img src="http://www.friendly-stranger.com/halp/ie-width/koala-squash.jpg" /></p>

<p>The JavaScript code I use:   </p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(function(){
        var img = new Image();
        img.src = 'Koala.jpg';
        $('div').append(img);
    }); 
&lt;/script&gt;
</code></pre>
