From: eschl on
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
}

From: Randy Webb on
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/
From: David C. Wilson on
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/AJAX%3AGetting_Started

 | 
Pages: 1
Prev: window.open
Next: Array in javascript