title: Data retrieval error in Jquery
body: <p>I'm trying to retrieve data from a php file named return that contains <code>&lt;?php
  echo 'here is a string';
  ?&gt;</code>. I'm doing this through an html file containing ` 
  
  
    
    div { color:blue; }
    span { color:red; }
    
    
     
    var x;
    $.get("return.php", function(data){
     x = data;
   }) 
   function showAlert() {alert(x);}</p>
  
  <p>$(document).ready(function(){
     alert(x);
   });
    
  
  
    
  </p>
  
  <p>` When the button is clicked it retrieves and displays the code fine, but on the page loading, it displays "undefined" instead of the data in return.php. Any solutions?</p>