Find IP Address using Javascript | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

Find IP Address using Javascript

Monday


How to find IP Address using Javascript?
   I'm using an external tool to find the Ip address through javascript.If you want you can use this
<html>
<head>
<title>What Is Your Ip</title>
<script language="JavaScript">
<!--

 var ip_list {};
function 
FoundIp(ip, type) {
 // type: 4=ipv4 6=ipv6 0=unknown (autodetect)
if (type == 0) {
type 
4;
if 
(ip.indexOf(':') !-1) type 6;
}
ip_list[ip] 
type;
}

function MyIpIs() {
for(ip in ip_list) {
document.getElementById('myIp').innerHTML ip;

}
// -->
</script>
<script language="JavaScript" src="http://only-ip4.wimip.fr/ip.php"></script>
</head>
<body onload="MyIpIs();">
 <span>Your IP Address Is:</span>
<span id="myIp"></span>
</body>
</html>



Online Demo:
In this example I'm using an external tool to find the Ip address through javascript.If you want you can use this
Your IP Address Is:

3 comments:

saxamo said...

this is awesome.. any chance I can get the ip.php file for my own personal server. It is for my own usage and no one elses.

Thanks!

phpFastCache said...

This one give you more option. http://www.easyjquery.com/api/1-detect-client-visitors-ip-country-city-javascript-jquery-php.html

Anonymous said...

I do used you code but I modified it to be used in silverlight. Can't I do that?

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets