"prototype.js" & responseXML
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

"prototype.js" & responseXML

From: eschl <edgar.schleime@web.de>
Date: Thu Feb 02 2006 - 13:53:26 CET

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
}
Received on Tue Feb 7 21:31:18 2006