Get Your IP with JQuery December 26, 2011Posted by Tournas Dimitrios in JQuery.
To retrieve your IP Address using JSONP and jQuery , use the following code :
In the code above , we are calling a service which supports JSON calls . If the request URL includes the string “callback=?“, the request is treated as JSONP.
JSONP comes with its own set of security risks . Read this article to explore ways to minimize this risks .
Note: As of jQuery 1.5 , all of jQuery’s Ajax methods return a superset of the XMLHTTPRequest object i.e. the jQuery XHR object . Read more here