开发者

How to retrieve the image in javascript

开发者 https://www.devze.com 2023-01-02 07:17 出处:网络
I have one url , which returns an image tag.Now i need to call this url using javascript , and embed this returnunder a div tag.

I have one url , which returns an image tag.Now i need to call this url using javascript , and embed this return under a div tag. I was trying $.get(), but "data" is returning some text.How to retrieve the image in javascript. note: pls provide sln with javascript/jq开发者_JAVA技巧uery.

Edit: data returns GIF40 or soem this kind of arbitary value..


try

$.ajax({
   method: 'get',
   url: 'image.php',
   success: function(data){
      $('#divId').append($(data).find('img')); 
  }

})
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号