How to get client IP Address with JQuery

Posted By  RRaveen On 01 May 2010 21:05:41
emailbookmarkadd commentsprint
No of Views:5215
Bookmarked:0 times
Votes:0 times

Introduction

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"];

 

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 anothere IPaddress provider server. the callback function will return the Your PC IP Address.

I hope this is help to you all.

 

Sign Up to vote for this article
Other popular Tips/Tricks
Comments
By:AdminDate Of Posted:5/1/2010 10:58:37 PM
The Great code
This is absolutely great code
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top