title: jquery ajax get return value
body: <p>i want to get the 'printed value' of html pages.</p>
  
  <p>i tried below query, but showGetResult() just return 'null value'</p>
  
  <p>but my apache server logs printed i accessed index.php when i try this code.</p>
  
  <p>(index.php just print helloworld)</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"&gt;&lt;\script&gt;
  &lt;script type="text/javascript"&gt;
  function showGetResult( name )
  {
       var result = null;
       jQuery.ajax({
          url: 'http://localhost/index.php',
          type: 'get',
          dataType: 'text/html',
          success:function(data)
          {
              alert(data);
              result = data;
          } 
       });
       return result;
  }
  
  document.write(showGetResult('test'));
  &lt;/script&gt;
  </code></pre>