D
david
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.
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.