javascript getting client ip
<p>Hi I found how to get client ip by answer here:
<a href="http://stackoverflow.com/questions/102605/can-i-lookup-the-ip-address-of-a-hostname-from-javascript">http://stackoverflow.com/questions/102605/can-i-lookup-the-ip-address-of-a-hostname-from-javascript</a></p>

<p>But I don't understand how to use it. </p>

<p>This is what I have:</p>

<pre><code>var user;
if ($('#user-id').length) {
    user = $('#user-id').text();
} else {
    http://jsonip.appspot.com/?callback=getip
    function getip(json){
       user = json.ip;
    }
}
</code></pre>

<p>I don't understand how to include the url and how to use the getip function.</p>

<p>I need to set the user to the ip address in the else.</p>

<p>Thanks!</p>
