Do you upload images dynamically and want to display them after upload?
As long as "data" is a javascript variable containing strings, your images will not load ...
To load images before embedding them on the page, you will need to make them dom elements.
I don't know if this is the best option, but I think this works:
$.ajax({ type: "POST", url: 'ajax.php', data: 'url='+variable, success: function(data){ $('<div />').html(data).load(function(){ $(this).appendTo("#myDiv"); }) });
Andre source share