Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1446 How can I get the ip address of the client using JavaScript?

irt.org | Knowledge Base | JavaScript | General | Q1446 [ previous next ]

Q1446 How can I get the ip address of the client using JavaScript?

Only in Netscape unless you write a Java Applet:

<script language="JavaScript"><!--
if (navigator.appName=='Netscape' && navigator.javaEnabled()) {
   hn = java.net.InetAddress.getLocalHost().getHostName();
   ha = java.net.InetAddress.getLocalHost().getHostAddress();
   document.write('HostName: '+ hn + '<br>' + 'HostAddress: '+ ha );
}
//--></script>

Feedback on 'Q1446 How can I get the ip address of the client using JavaScript?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.