$.getJSON('http://jsonip.appspot.com?callback=?', function (data) { var ip = data.ip; $('#ip').text(ip); });