Re: problem setting array for xml load
Uberdoer,
>From looking at your code I think the problem is based on a slight
misunderstanding of how the GXmlHttp request object functions. You are
trying to return an object from the function that loads the XML file,
but that's not how it works. Instead, try putting that alert into the
onreadystatechange area and see the difference.
What you should do instead is pass a function to that loader, and have
that function act on the data instead of trying to return the xml
object.
The way the GXmlHttp request object works is a bit confusing until you
realize that it doesn't execute inline, but instead operated out of
line. Once you call the request object, control returns to the next
line in the code while the "get" happens in the background, so to
speak. The request object waits patiently for the server to return the
results (the onreadystate = 4 thing) then acts on the received data.
I have an example of this at:
http://www.katzo.com/clas56.htm
I'm essentially doing the same thing you are trying to do, but instead
I'm passing a function as a parameter to the loader and having that
function do the work of parsing.
Make sense? Probably not, but check it out anyway. Once you get the
timing issue figured out, you'll be on your way.
-John
http://maps.huge.info
0 Comments:
Yorum Gönder
<< Home