5/08/2012

Show Your IP by JSON JQuery

Function javascript:

   1:  function ShowMyIP() {
   2:      var url = "http://jsonip.appspot.com?callback=?";     
   3:      $.getJSON(url, function(data) {
   4:          //show client IP from url
   5:          $('#ip_location').html("Your Ip Location:" + data.ip);         
   6:      });
   7:  }

 

Html:

<div id=”ip_location”></div>

JQuery call function

   1:  $(document).ready(function() {    
   2:      ShowMyIP();   
   3:  });

Categories:
If You Enjoyed This Post Please Take 5 Seconds To Share It.

0 comments:

Post a Comment

 
  • Followers