How to set variable to responsetext from an Ajax Request

Hi.

I have been wondering, is it possible to set a variable to the
responsetext from an Ajax Request event?

var something = ""
Ajax.Request("http://google.dk", {
  onComplete: function(e){
    something = e.responseText;
  }
});
alert(something)

This does not work, but I hope you see the point in what I’m trying to
do?!

  • Emil