~~~
<script type="text/javascript">
$.get("http://ipinfo.io", function (response) {
$("#ip").html("IP: " + response.ip);
$("#address").html('<input type=text readonly class=reg2_input id=ulocate name=ulocate value="' + response.city +', '+ response.country + '">');
$("#details").html(JSON.stringify(response, null, 4));
}, "jsonp");
</script>
~~~