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:
jQuery
0 comments:
Post a Comment