Prototype Ajax.Request: how can i return responseXML to main function

Discussion in 'Javascript' started by alex.david@gmx.de, Jul 13, 2006.

  1. Guest

    Hi,

    in tutorials you find this code sample:
    Code (Text):

    var myMap;
    ....
    var url = "my_xml.xml";
    var myAjax = new Ajax.Request(
    url,
    {
    method: 'get',
    onComplete: showResponse
    });

    // here i need something like:
    // response = someObject.responseXML;
    // so i can do this:
    // myMap.createSomeMarkersWith(response);
    ....

    function showResponse(request){
    doSomethingwith(request.responseXML);
    }
     
    How can I use the responseXML in the "calling function"?
    Reason is, I don't want to pass all the vars through the functions (and
    I don't know how, anyway).
    myAjax doesn't seem to have a responseXML or anything helpful at all.

    Thanks in advance
    Alex
     
    , Jul 13, 2006
    #1
    1. Advertisements

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. Army1987

    int main(void) { return main(); }

    Army1987, Mar 29, 2007, in forum: C Programming
    Replies:
    37
    Views:
    1,756
    Daniel Rudy
    Apr 3, 2007
  2. ravi
    Replies:
    28
    Views:
    1,314
    Richard Heathfield
    Sep 26, 2007
  3. June Lee
    Replies:
    2
    Views:
    1,039
    Jim Cobban
    Apr 13, 2008
  4. eschl

    "prototype.js" & responseXML

    eschl, Feb 2, 2006, in forum: Javascript
    Replies:
    2
    Views:
    186
    David C. Wilson
    Feb 2, 2006
  5. Jake Barnes
    Replies:
    1
    Views:
    171
    Thomas 'PointedEars' Lahn
    Feb 7, 2006
  6. Replies:
    5
    Views:
    226
    Eric Ryan Harrison
    Jun 11, 2006
  7. MD
    Replies:
    1
    Views:
    367
  8. Kreisquadratur
    Replies:
    2
    Views:
    105
    jdalton
    May 2, 2008
Loading...