Easy way is this one. Combine http://smart-ip.net/geoip as JSON and jQuery:

Code:
$(document).ready( function() {
    $.getJSON( "http://smart-ip.net/geoip-json?callback=?",
        function(data){
            alert( data.host);
        }
    );
});