title: jQuery and ajax response function
body: <p>I have these functions. My objective is separate the load function to the rest of the script because i want to customize the loading message</p>
  
  <pre><code>function loadContent(url)
  {
      $('body').html('Loading');
      content = load(url);
      $('body').html(content);
  }
  
  function load(url)
  {
  
      var result = null;
      var scriptUrl = url;
      $.ajax({
          url: scriptUrl,
          type: 'get',
          dataType: 'html',
          async: false,
          success: function(data) {
              result = data;
          } 
      });
      return result;
  }
  </code></pre>
  
  <p>Now, I call the loadContent function:</p>
  
  <pre><code>$(document).ready(function(e) {
      loadContent('index.php');    
  });
  </code></pre>
  
  <p>The problem is in this line:</p>
  
  <pre><code>content = load(url);
  </code></pre>
  
  <p>because the function load() override the loading message.</p>
  
  <p>How can I solve this?
  Thanks guys!</p>