The below code snippet explains how to get IP Address of the client machine using JSON and jQuery
<script type = "text/javascript" src=""></script>
<script type="text/javascript">
    $(function () {
        $.getJSON("", DisplayIP);
    function DisplayIP(response) {
        $("#ipaddress").html("Your IP Address is " + response.ip);
<span id = "ipaddress"></span>
Above in the document ready event of the HTML page I am executing the jQuery getJSON  method which internally makes a JSON call to  which is a free web service that determines and returns the IP Address of the machine making the request.
I have also specified a callback function which is executed when the response is received and it displays the IP address in the HTML span with ID ipaddress.