By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

xmlhttp response -- non xml?

P: n/a
Hello,

Just playing around with xmlhttp at the moment. I was just wondering if
there is any reason (browser compatibility etc) the response data has to
be formatted in xml, or can I send csv or whatever else if the handler
is up for it?

Cheers
-J

--
Jason Morehouse
Vendorama - Create your own online store
http://www.vendorama.com
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a


Jason Morehouse wrote:

Just playing around with xmlhttp at the moment. I was just wondering if
there is any reason (browser compatibility etc) the response data has to
be formatted in xml, or can I send csv or whatever else if the handler
is up for it?


There is both a responseText and a responseXML property so if you don't
want to use XML you can receive other text as needed but need to be
aware that responseText doesn't pay attention to encodings so you should
send the text as UTF-8 from the server if you need characters in
responseText that are outside of ASCII. And of course with
sending/receicing XML you get it parsed and can access it in responseXML
using the DOM while for csv you need to write your own parsing routine
first.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

P: n/a
Martin Honnen wrote:
There is both a responseText and a responseXML property so if you don't
want to use XML you can receive other text as needed but need to be
aware that responseText doesn't pay attention to encodings so you should
send the text as UTF-8 from the server if you need characters in
responseText that are outside of ASCII. And of course with
sending/receicing XML you get it parsed and can access it in responseXML
using the DOM while for csv you need to write your own parsing routine
first.


Ah, that makes sense. Thanks!
--
Jason Morehouse
Vendorama - Create your own online store
http://www.vendorama.com
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.