How to retrieve the image in javascript
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'));
}
})
精彩评论