Display an image as response to jQuery ajax request
Im working on converting and editing images with php "wideimage" class.
I have a php file which is called with ajax from html and then it outputs a image which i have to display in html.
The开发者_运维知识库 php file outputs an image everytime which i have to catch it and display in html. When user uploads the image..It dosent get stored anywhere the wideimage class takes care of it and outputs an image.
Modified example from jQuery docs, assuming php returning image path (data).
$.ajax({
url: 'wideimage.php',
success: function(data) {
$('.result').html('<img src="' + data + '" />');
}
});
精彩评论