How is your Handler returning the image? As binary or as the actual image? Why not use an img element and set the url to your handler if you are just returning the image? Javascript is not really meant to deal with binary data such as raw images.
"What I hear, I forget; What I see, I remember; What I do, I understand." --Confucius
Remeber to Mark as Answer if this post helped you.
ramll
Participant
1126 Points
1299 Posts
Display Image Using Jquery
Dec 19, 2012 09:07 PM|LINK
Hello,
Below is my code. I am getting the Image from different server using File Handler. After getting the Image, I want to display it in DIV.
How can I do this ? What line of code, I have to add to the below code ?
$.ajax({ url: "ImageHandler.ashx?Template=" + selectedCaption, contentType: "application/json; charset=utf-8" }); return false;grundebar
Contributor
4515 Points
726 Posts
Re: Display Image Using Jquery
Dec 19, 2012 09:55 PM|LINK
How is your Handler returning the image? As binary or as the actual image? Why not use an img element and set the url to your handler if you are just returning the image? Javascript is not really meant to deal with binary data such as raw images.
Remeber to Mark as Answer if this post helped you.
senthilwaits
Contributor
3832 Points
651 Posts
Re: Display Image Using Jquery
Dec 20, 2012 12:46 PM|LINK
Please refer
http://stackoverflow.com/questions/10802312/display-png-image-as-response-to-jquery-ajax-request
Senthil Kumar Sundaram