Doesn't work. :)
I am using Google maps example from book, and from Google
documentation. It is really simple, and I don't know why isn't
working. My browser send mi this response:
This XML file does not appear to have any style information associated
with it. The document tree is shown below.
<markers id="id je ok">
<marker found="Keychain " lat="37.441" left="Book" lng="-122.141"/>
<marker found="Water Bottle" lat="37.322" left="Necklace"
lng="-121.213"/>
</markers>
My code is following
var getVars = "?q=" + search;
var request = GXmlHttp.create ();
request.open('G ET', '/lbs/' + getVars, true);
request.onready statechange = function() {
if (request.readyS tate == 4) {
var xmlDoc = request.respons eXML;
alert(xmlDoc);
var responseNode = xmlDoc.getEleme ntsByTagName('m arkers').item(0 );
var type = responseNode.ge tAttribute("id" );
}
}
responseXML allways sends back null value, although server sends back
XML. And, what I don't understanf (still newbie), after the alert
popups and write "null", my browser render upper XML file, instead
doing nothing and show page from which I called AJAX function. How
can this be?
I am using Google maps example from book, and from Google
documentation. It is really simple, and I don't know why isn't
working. My browser send mi this response:
This XML file does not appear to have any style information associated
with it. The document tree is shown below.
<markers id="id je ok">
<marker found="Keychain " lat="37.441" left="Book" lng="-122.141"/>
<marker found="Water Bottle" lat="37.322" left="Necklace"
lng="-121.213"/>
</markers>
My code is following
var getVars = "?q=" + search;
var request = GXmlHttp.create ();
request.open('G ET', '/lbs/' + getVars, true);
request.onready statechange = function() {
if (request.readyS tate == 4) {
var xmlDoc = request.respons eXML;
alert(xmlDoc);
var responseNode = xmlDoc.getEleme ntsByTagName('m arkers').item(0 );
var type = responseNode.ge tAttribute("id" );
}
}
responseXML allways sends back null value, although server sends back
XML. And, what I don't understanf (still newbie), after the alert
popups and write "null", my browser render upper XML file, instead
doing nothing and show page from which I called AJAX function. How
can this be?
Comment