Hi! everybody!
I am facing one problem.
How to get data from response, where content type is image/jpg ore image/gif.
normally browser do it for us, when it encounters an image tag, it sends an image request to the server, then reads the response and replaces img tag by image.
Now what I want to do is as follows:
step1: send an asynchronous request(request for image) to server.
step2: server reads the image from database, creates an image response, and returns back result.
step3: at onreadystate=4, client reads response data, creates image element, and provide response data to image element.
My problem is at step3.
as far as I know we can only get response body in two ways from XMLHTTPResponse object, as simple text & second as xml.
How to get data having MIME type other than text/html & text/xml.
Its really urgent, any suggession & help will be greatly appreciated.
Thanks in advance.
I am facing one problem.
How to get data from response, where content type is image/jpg ore image/gif.
normally browser do it for us, when it encounters an image tag, it sends an image request to the server, then reads the response and replaces img tag by image.
Now what I want to do is as follows:
step1: send an asynchronous request(request for image) to server.
step2: server reads the image from database, creates an image response, and returns back result.
step3: at onreadystate=4, client reads response data, creates image element, and provide response data to image element.
My problem is at step3.
as far as I know we can only get response body in two ways from XMLHTTPResponse object, as simple text & second as xml.
How to get data having MIME type other than text/html & text/xml.
Its really urgent, any suggession & help will be greatly appreciated.
Thanks in advance.
Comment