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:
    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. 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. June Lee
    Replies:
    2
    Views:
    786
    Jim Cobban
    Apr 13, 2008
  2. eschl

    "prototype.js" & responseXML

    eschl, Feb 2, 2006, in forum: Javascript
    Replies:
    2
    Views:
    91
    David C. Wilson
    Feb 2, 2006
  3. MD
    Replies:
    1
    Views:
    218
  4. Pugi!
    Replies:
    1
    Views:
    333
    Martin Honnen
    Dec 4, 2006
  5. KDawg44

    AJAX Help - responseXML always NULL

    KDawg44, Aug 2, 2008, in forum: Javascript
    Replies:
    6
    Views:
    205
    KDawg44
    Aug 3, 2008
Loading...

Share This Page