Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

undefined being returned instead of xml node value

Status
Not open for further replies.

gwu

MIS
Dec 18, 2002
239
US
I am trying to call a functoin which will use the xml object to retrieve data and return the data to the function call. When I trace "test_var" inside the "book_xml.onLoad" functoin, it works. but I can pass the xml data out of the get_data function. Can anyone help???

********************
stop();

//define function
function get_data(id) {
book_xml = new XML();
book_xml.ignoreWhite = true;
book_xml.onLoad = function(sucess) {
test_var = book_xml.firstChild.childNodes[0].childNodes[0].firstChild;
};
book_xml.load("school_xml.asp?id=" + id);
return test_var;
}

//call function and retriev value
ret_var = get_data("105");

//trace value
trace(ret_var);
********************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top