Click here to Skip to main content
15,922,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to dynamically add images to a web page using jQuery. What I do is look for image tags in the document(I am using SVG) and then read certain atributes from them, then create a div with the html image in it. Here is my code:

JavaScript
$(document).ready(function () {
    $('image').each(function () {
        var src = $(this).attr('xlink:href');
        var width = $(this).attr('width');
        var height = $(this).attr('height')
        var x = $(this).attr('fdtactualx');
        var y = $(this).attr('fdtactualy');
        $('#text').append('<div style="position: absolute; top:' + y + 'px; left:' + x + 'px;"><img src="' + src + '" height="' + height + 'px" width="' + width + 'px" border="0" /></div>');
    });
});


This works fine in Chrome, but the output in IE is the following:

HTML
<div style="removed: absolute;"/>


If someone knows why it wont load an image, please do help.

Thanks,
-Dom
Posted
Comments
ZurdoDev 27-Apr-12 20:24pm    
What happens when you step through it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900