How can I return that values

Discussion in 'Javascript' started by Mariano, Jan 14, 2008.

  1. Mariano

    Mariano Guest

    Then, I have this script:

    function mainFunction(src, type) {
    // ...
    if(XMLHttpRequestObject) {
    XMLHttpRequestObject.open(type, src, true);
    XMLHttpRequestObject.onreadystatechange = function(){
    if (XMLHttpRequestObject.readyState == 4 &&
    XMLHttpRequestObject.status == 200) {
    var xmlDocument = XMLHttpRequestObject.responseXML;
    var returnValue = calling(); //<==FUNCT
    }
    }
    XMLHttpRequestObject.send(null);
    }

    }

    function calling() (see the //<==FUNCT marker), when executed, return
    a boolean value. Now since this function, is never called directly,
    but always from mainFunction() function [and through anonymouse
    function], I need that mainFunction return at the end the same value
    of calling() execution [returnValue]. How can I do It?
    Thanks.
    Mariano, Jan 14, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Dixson
    Replies:
    1
    Views:
    497
    Joe Fallon
    May 18, 2004
  2. Greenhorn
    Replies:
    15
    Views:
    800
    Keith Thompson
    Mar 6, 2005
  3. Chris Rebert
    Replies:
    1
    Views:
    672
    Bobby
    May 28, 2009
  4. DonaldN
    Replies:
    1
    Views:
    525
    Josh Twist
    Feb 17, 2006
  5. Kelly Dwight Felkins
    Replies:
    6
    Views:
    120
    Jeremy Henty
    Feb 9, 2006
Loading...

Share This Page