I want to load an XHTML file into DOM. I issue Ajax.Request and on
success do:
var response=transport.responseXML
Response is null. On the other hand:
var response=transport.responseText; // has the data.
Why is response=transport.responseXML returns null?
Here is the code:
function display() {
url = "http://" + location.hostname + port + "/fusion/
restlet/";
url = url + "engines" + sServer;
new Ajax.Request(url,
{
method:"get",
contentType:"application/xhtml+xml",
onSuccess: function(transport) {
var response = transport.responseXML; // null ?
//var response = transport.responseText; // OK
alert("after response=" + response);
if (response != null) {
alert("b=" +
response.getElementById('lastUpdate').innerHTML); // this never works
}
else
alert("onSuccess, responseXML is null");
},
onFailure: function(){ alert("Cannot get data from server:
" + location.host) }
});
}
Regards,
Tobie
Regards,
Tobie
On Sep 28, 12:39 am, AlexK <alexkoif...@gmail.com> wrote:
did not change anything. ANy other ideas? Thanks.
> > }- Hide quoted text -
>
> - Show quoted text -
<meta http-equiv="Content-Type" content="text/xml; charset=UTF-8" />
and this:
new Ajax.Request(url,
{
method:"get",
contentType:"text/xml",
onSuccess: function(transport) {
And I still get null: var response =
transport.responseXML;
Thanks!
header("Content-Type: text/xml");
and this code for ColdFusion.
<cfheader charset="utf-8" name="Content-type" value="text/xml">
Cheers,
Matt