Can I get the image and load via ajax into div

前端 未结 4 1896
星月不相逢
星月不相逢 2020-12-06 08:07

I have the code below and what I need to do is load the image from the href into a div via ajax... Any help appreciated. I believe that load() can\'t load images like this?<

4条回答
  •  温柔的废话
    2020-12-06 09:03

    This would be the first thing I would try, I'm also a bit of a beginner as well though:

    var image = $('');
    image.attr('src', 'images/image1.jpg');
    $('#image-holder').append(image);
    

提交回复
热议问题