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?
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:
or
instead of: