> Take on account that in Ajax, the browser does not make a normal HTTP
request, but an 
> XmlHttpRequest from Javascript, and then expects an XML fragment as a
response (a piece of DOM tree
> as far as I know). I cannot imagine how could you transmit an image
via Ajax, but if it is 
> possible, please let me know :) 

The name "XmlHttpRequest" is a mite misleading: You are doing a HTTP
request, but the response need not be XML. For image data you could
return it as a Base64-encoded string and get it using the request
object's responseText attribute. However, the issue with using Ajax to
retrieve images is that the standard for "inline" images in't supported
by MSIE, so its utility is limited to Firefox, Opera and (possibly)
Safari/KHTML users, using a "data" protocol URL.

http://www.sweeting.org/mark/blog/2005/07/12/base64-encoded-images-embed
ded-in-html

So in your callback handler for "success" you would put something like

        getElementById('theImage').src = 'data:image/jpeg;base64,' .
this.responseText;

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to