title: Why can't I capture a variable inside a get call?
body: <p>This is my code: </p>
  
  <pre><code>var user_ip ="not found";
  
  $.get("http://ipinfo.io", function(response) {
     var user_ip=response.ip; 
     alert("on line 749 user ip is " + user_ip);
  }, "jsonp");
  alert("on line 751 user ip is " + user_ip);
  </code></pre>
  
  <p>Yet my user ip only get saved within the .get, afterwards it always reverts to "not found".</p>
  
  <p>I know this involves using a call back to save the data but cant find an example of how to do it that makes sense to me</p>