title: Get URL content using jquery
body: <p>I am reading content of a local file using <code>jquery</code> and I get <code>undefined</code>.</p>
  
  <p>I feel the problem is related to synchronization of URL loading. But I don't have any idea about how to fix this code:</p>
  
  <pre><code>function url_content(url)
  {
      var content;
      $.get(url,function( data ) {content=data});
      return content;
  }
  
  
  var content=url_content("local_templates/template1.html");
  alert(content);
  </code></pre>