First of all, small example:
function GetURL()
{
        new Ajax.Request('/updater.php?GetURL=yes',
        {
        method:'get',
        onSuccess: function(transport){
                response = transport.responseText;
                alert(response);
        }
    });
}

PHP script echo URL, AJAX gets it and response should be and is
"http://localhost/forum";. So far everything is okay, but I would like
GetURL() return that response and I can't get it out from new
Ajax.Request. Let's say I would write like this:

function GetURL()
{
        var response;

        new Ajax.Request('/updater.php?GetURL=yes',
        {
        method:'get',
        onSuccess: function(transport){
                response = transport.responseText;
        }
    });

    return response;
}

But it won't happen ever. response will be set as unidentified. Any
ideas how I could make GetURL() to return what I need?

P.S. Thanks for your all help.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to