jquery getJSON IP
<p>I am trying to convert the following code to work with jquery:</p>

<pre><code>var req = new XMLHttpRequest(); 
  req.open('GET', 'http://jsonip.appspot.com', true); 
  req.onreadystatechange = function (e) { 
    if (req.readyState === 4) { 
      if(req.status === 200) {
        var ip = JSON.parse(req.responseText);
        alert(ip.address);
      } else { 
        alert("Error loading page\n"); 
      }
    } 
  }; 
  req.send(null);
</code></pre>

<p>This the jquery piece that doesn't work:</p>

<pre><code>  $.getJSON("http://jsonip.appspot.com",
        function(data){
             alert( "Data Returned: " + data.ip);

        });
</code></pre>
