Save string from jQuery's `$.get`
<p>I'd like to load some content from an URL, to use it in my code. I tried closures and this:</p>

<pre><code>function getStringFromURL(url) {
  var getter = function() {
    this.result = "undef";
    this.func = function(response) {
      this.result = response;
    };
  };
  var x = new getter();
  $.get(url, x.func);
  return x.result;  // the it returns "undef" and not the wanted response
}
</code></pre>

<p>Nothing worked at all. I'll never got the content, but if I call it with <code>alert</code> like <code>$.get("http://localhost:9000/x", function(response) { 
    alert(response) 
});</code> it works -- but I'd like to save the response. I think theres a problem with the scope of the <code>$.get</code>-method.</p>

<p>Whats wrong with this?</p>
