Q:

IE8 fails to display dynamically added image

I have jQuery code like this workig fine in FF, but totally fails in IE8:
$('#tekst img').each(function(){
                    var scrValue = $(this).attr('src').substring(0,4);
                    var imgTyp = $(this).attr('class').substring(1);
                    if(scrValue == 'tbid')
                    {

                      var splitedString = $(this).attr('src').split(':');
                      var imageID = splitedString[1];
                      $(this).append("<img src='ShowImage.ashx?ID=" + imageID + "' alt= '' />"); 

                    }      
              });

In 'IF' part, IE exits after first (srcValue== true) and even fails to display that first one image..
Does anyone have any ideas? 

A:

it seem that you are apeending that new image element inside an img element...
i dont think this is what you inteneded to do..
if you want to add that img after the image you just selected you could use the after() function in jquery. 
or if you want to add the img to your images container you could do something like:
$("#tekst").append("<img src='ShowImage.ashx?ID=" + imageID + "' alt= '' />");

or
$(this).parent().append("<img src='ShowImage.ashx?ID=" + imageID + "' alt= '' />");

instead of:
$(this).append("<img src='ShowImage.ashx?ID=" + imageID + "' alt= '' />");  

