$('<img />')
.attr('src', val)
.attr('width', "400")
.load(function(){
$('.showdata').append( $(this) );
}
);
This works perfectly for images, how would this convert 1:1 to iframes?
Here quick jsfiddle:
http://jsfiddle.net/ET8Gw/
Unlike Image objects, IFrames will not load until they are part of the DOM.
To get around this you can hide the element, add it to the DOM, and when the load event fires show it:
http://jsfiddle.net/ET8Gw/1/