You are here: irt.org | FAQ | JavaScript | VFAQ | Q1685 [ previous next ]
In Netscape Navigator try the following, which requires Java to be enabled:
<script language="JavaScript"><!-- if (navigator.appName == 'Netscape' && navigator.javaEnabled()) { var myAddress = java.net.InetAddress.getLocalHost(); var host = myAddress.getHostName(); var ip = myAddress.getHostAddress(); document.write('hello '+ host + '\n' + ip); } //--></script>
In both Internet Explorer and Netscape Navigator try:
<script src="http://jshelper.pharlap.com/utils/ipaddr.js"></script> <script language="JavaScript"><!-- if (typeof(IPAddr) == 'undefined') alert('IP Address is unknown'); else alert('IP Address is ' + IPAddr); //--></script>