With using Smart-IP.net
Geo-IP API. For example, by using jQuery:
<script src="jquery.js"></script>
<script>
$(document).ready( function() {
$.getJSON( "http://smart-ip.net/geoip-json?callback=?",
function(data){
$('#myip').html( data.host);
}
);
});
</script>
<div id="myip"></div>