Mam stronę [o wow, ale ze mnie wyjątkowy gośc

Mam plik nazwa_ajax.php, który zwraca coś takiego:
Kod
<?xml version="1.0" encoding="utf-8"?>
<datas>
<id>1</id>
<img>4</img>
<user>atsr</user>
<x>19.1445083333333</x>
<y>50.7737416666667</y>
<city>Błeszno</city>
<country>PL</country>
<ignition>Y</ignition>
<speed>2.62</speed>
<battery>4.79</battery>
<date>2007-08-16 23:56:16</date>
</datas>
<datas>
<id>1</id>
<img>4</img>
<user>atsr</user>
<x>19.1445083333333</x>
<y>50.7737416666667</y>
<city>Błeszno</city>
<country>PL</country>
<ignition>Y</ignition>
<speed>2.62</speed>
<battery>4.79</battery>
<date>2007-08-16 23:56:16</date>
</datas>
Dane te odczytywane są z bazy danych. Przez słowo zwraca ma na myśli wyświetla za pomocą echo().
Teraz mam kod JS:
Kod
// tu kod tworzacy obiekt XMLHttpRequest, oraz funkcja łącząca się z odpowiednim plikiem PHP
var xotree = new XML.ObjTree();
var xml = xmlHttp.responseXML; // get info (xml)
var tree = xotree.parseXML( xml ); //TU JEST CHYBA PROBLEM
var id = tree.datas.id;
var imgsrc = 'images/tr1'+tree.datas.img+'.gif';
var div_html = '<img src="'+imgsrc+'" alt="@" /> '+tree.datas.user+'<br />ignition: '+tree.datas.ignition+'<br />where:'+tree.datas.city+' ('+tree.datas.country+')<br />speed: '+tree.datas.speed+'<br />battery: ' +tree.datas.bettery;
// change the content of the bubble speech
document.getElementById("vehicle"+id).innerHTML = div_html;
// change the icon
document.getElementById("img"+id).src = imgsrc;
// change the location of the icon
createMarker1( new GLatLng(tree.datas.y, tree.datas.x), tree.datas.img, 'vehicle'+id );
} else alert("Access denied: " + xmlHttp.statusText);
var xotree = new XML.ObjTree();
var xml = xmlHttp.responseXML; // get info (xml)
var tree = xotree.parseXML( xml ); //TU JEST CHYBA PROBLEM
var id = tree.datas.id;
var imgsrc = 'images/tr1'+tree.datas.img+'.gif';
var div_html = '<img src="'+imgsrc+'" alt="@" /> '+tree.datas.user+'<br />ignition: '+tree.datas.ignition+'<br />where:'+tree.datas.city+' ('+tree.datas.country+')<br />speed: '+tree.datas.speed+'<br />battery: ' +tree.datas.bettery;
// change the content of the bubble speech
document.getElementById("vehicle"+id).innerHTML = div_html;
// change the icon
document.getElementById("img"+id).src = imgsrc;
// change the location of the icon
createMarker1( new GLatLng(tree.datas.y, tree.datas.x), tree.datas.img, 'vehicle'+id );
} else alert("Access denied: " + xmlHttp.statusText);
Wykorzystuję tu bibliotekę ObjTree http://www.kawa.net/works/js/xml/objtree-e.html
Oto jaki błąd otrzymuję w Operze:
Cytat("Opera - Debian")
Unknown thread
Error:
Unhandled exception: [Object LSException]
code: 81
Error:
Unhandled exception: [Object LSException]
code: 81
W przypadku FF trochę więcej się dowiaduję:
Cytat
Error: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMParser.parseFromString]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://atsrpl.no-ip.pl:90/js/objtree.js :: anonymous :: line 30" data: no]
Source File: http://atsrpl.no-ip.pl:90/js/objtree.js
Line: 30
Source File: http://atsrpl.no-ip.pl:90/js/objtree.js
Line: 30
Moje przewidywania:
Sądzę, że
Kod
var xotree = new XML.ObjTree();
var xml = xmlHttp.responseXML; // get info [xml]
var tree = xotree.parseXML( xml );
var xml = xmlHttp.responseXML; // get info [xml]
var tree = xotree.parseXML( xml );
zmienna xml nie jest tu kodem, a jest za to obiektem [?] A do metody parseXML należy podać kod XML. Inną możliwością jest to, że xml jest pusty [na co wskazuje komunikat FF - komunikat Opery mówi z kolei o obiekcie!]. Wg tego co sam probowalem, to jak wrzucę coś takiego:
Kod
var xotree = new XML.ObjTree();
var xml = "<? xml ....><cos>bla</cos>";
var tree = xotree.parseXML( xml );
var xml = "<? xml ....><cos>bla</cos>";
var tree = xotree.parseXML( xml );
To działa.
czy jest to problem z tym, że jakoś źle się zabieram do przesyłania danych ze skryptu PHP? Może to nalezy robić w inny sposób niż przez echo? A może problem leży po stronie JS, w miescu przeze mnie zaznaczonym?
Bardzo dziękuję za poświęcony czas i wszelkie uwagi mogące mi pomóc.