Check if load failed on dynamically added images
<p>I add images dynamically, simply but appending an img tag, with a dynamic source, to an existing div.
But, not all of these images will exist, and I would like to hide the ones, that doesn't.</p>

<p>I believe I can use load() and setup a hide function on error, but since I add them, simply by creating an img tag, I don't really know how to hook up my jquery to it.</p>

<p>Here is my add function:</p>

<pre><code>function GetImages() {
            $('#ImageContainer').empty();
            $('#ImageContainer').css("visibility", "visible");

            var regex = new RegExp("(.+?);", "g");
            var match;
            while (match = regex.exec($("#&lt;%= HttpSources.ClientID %&gt;").val())) {
                $('#ImageContainer').append('&lt;div class="ImgBox"&gt;&lt;img src="' +
                    match[1].format($("#&lt;%= ItemNo.ClientID %&gt;").val()) + '" class="Image" /&gt;&lt;/div&gt;');
            }

            return false;
        }
</code></pre>

<p>It adds a div with an img, into another div.</p>

<p>Originally, I wanted to do something like this, to hide them, but since the divs and images doesn't exist when the document is loaded, I don't really see how I can hook it up to them.</p>

<pre><code>$(document).ready(function() {
    $(".ImgBox").Next(".Image").load(function () {
        // ... loaded  
    }).error(function () {
        // ... not loaded
        $(this).hide();
    });
});
</code></pre>
