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

"prototype.js" & responseXML

P: n/a
Doesn't "prototype.js" support the "responseXML" property of the
XMLHttpRequest object?

var url = "test.jsp";
var pars = "";
var myAjax =
new Ajax.Request(url,
{method: 'get', parameters: pars,
onComplete: mycallback }

String sXml;
sXml = "<?xml version='1.0' encoding='utf-8' ?>";
sXml += "<response>aaa</response>";

function mycallback(req)
alert(req.responseText); // ok!
if (req.responseXML == null)
alert("does not work!");
// req.responseXML seems to be null

Feb 2 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
eschl said the following on 2/2/2006 7:53 AM:
Doesn't "prototype.js" support the "responseXML" property of the
XMLHttpRequest object?

Why don't you ask the people who wrote it?

comp.lang.javascript FAQ - & newsgroup weekly
Javascript Best Practices -
Feb 2 '06 #2

P: n/a
I seem to remember something about responseText being populated on
Content-type: text/html responses and responseXML being populated on
text/xml responses.

You can either set the content type from the server (php has a "header"
function) or you can override it at the client. See details at the
link. Please post back here if it worked for you. Also where is the
Ajax object defined?

Feb 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.