Of course, there is a decision.
You should just set asynchronous option to 'false':
var getURL = function() {
var response;
var request = new Ajax.Request('/updater.php?GetURL=yes', {
method: 'get',
asynchronous: false, /* it's really bad style */
onSuccess: function(transport) {
response = transport.responseText;
alert(transport.responseText)
}
});
return response;
}
For your information: it's really horrible and bad
method to use AJAX and prototype.js like this code do it.
But, I think, it should work like you wanted.
I don't recommend you to use this getURL() function.
Maybe it will be better to use ActionScript, or embed
url XHTML per PHP (using <?= php_variable ?>).
Don't forget, that you can use PHP not only to generate XHTML.
You can use it to generate JavaScript, for example:
<script>
var getURL = function() {
return <? your php code here ?>;
}
</script>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---