Hi *.*,
In this tips,show how we could get the client IPAddress with JQuery. Becase we know to get the client PC IPAddress usign ASP.NET
Using Server Side Code
Request.ServerVariables["REMOTE_ADDR"];
Request.ServerVariables["REMOTE_ADDR"];
Using Jquery
$(function() {
$('a').click(function()
{
$.getJSON("http://jsonip.appspot.com?callback=?",function(ipadd){
alert( "Your IPAddress is : " + ipadd.ip);
});
});
});
in above code,i have done a simple query the IPAddress using JSON to another IPaddress provider server. the callback function will return the Your PC IP Address.
$(function() {
$('a').click(function()
{
$.getJSON("http://jsonip.appspot.com?callback=?",function(ipadd){
alert( "Your IPAddress is : " + ipadd.ip);
});
});
});
in above code,i have done a simple query the IPAddress using JSON to another IPaddress provider server. the callback function will return the Your PC IP Address.
Have a nice day... 'N happy Coding :)
No comments:
Post a Comment