By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 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 }
);

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

"callbackfunction"
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?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
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?

http://developer.mozilla.org/en/docs...etting_Started

Feb 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.