When developing or maintaining a website there may be some features that only you want to see. An example could be a small box in the top right corner that tells you the screen width, which can be very useful when developing a responsive website. You may also want to block a person from a specific IP address from viewing your site.

There is a simple line of JSON code that you can add to a .js file that your site uses. This code will retrieve the IP Address of the user.

This line of code uses a function from the website jsonip.com to retrieve the IP address of the visitor.

$.get('http://jsonip.com', function (res) { 
        if(res.ip == ""){
            // put your code here