简体   繁体   中英

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 + '" />');
  }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM