How do I wait for an image to load after an ajax call using jquery?

后端 未结 3 509
一生所求
一生所求 2021-01-24 03:17

I have a Python script that is doing some manipulation on a JPEG image. I pass some parameters to this script and call it from my HTML page. The script returns an img src=\"newi

3条回答
  •  无人共我
    2021-01-24 03:20

    You can dynamically create a new image, bind something to its load event, and set the source:

    $('').bind('load', function() {
        $(this).appendTo('body');
    }).attr('src', image_source);
    

提交回复
热议问题