WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 xml extras, Al Val, August 24, 2003

Subject: xml extras From: Al Val Date: August 24, 2003


I want to return a value from a nested function ( done ) to the main function ( loadXmlFile ).
The problem is that the done() function is triggered by an event ( xmlHttp.onreadystatechange )
and I can't figure how to pass the done() returned value to the loadXmlFile() function:

function loadXmlFile(sUri, bAsync){
 var done = function () {
  try {
   if(xmlHttp.responseText == "False"){
    return false;
    return xmlHttp.responseText;
  catch (exc) {
   var err = "error..."   
   return err;
 var xmlHttp = XmlHttp.create();
 xmlHttp.open("GET", sUri, bAsync);
 if (bAsync) {
  xmlHttp.onreadystatechange = function () {
   if (xmlHttp.readyState == 4)
    return done();

How can I do that ?
Thanx, Al.



Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.

View All Messages
Back to WebFX