[Javascript] browser-problem

Terje Bremnes terjeb at ii.uib.no
Wed Aug 15 04:01:07 CDT 2001


Hi!

This is my first posting to this list. I hope you javascript-wizards can
help me out with the following problem :

I am writing a simple javascript for use on a web-page that will deny
access to another page for everybody not connected to a specified network
(specified by ip-adress prefix). The script works fine with Netscape, but
not with the Internet Explorer. I guess there are different ways for the
browsers to read and send information. Anyway, here is the script so far :

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
	ip = "" + java.net.InetAddress.getLocalHost().getHostName();
	if (ip.substring(0,10) != "xxx.xxx.xx")
	{
		alert("Access only if connected to LAN.");
   		history.go(-1);
	}
	else window.location = "destination.html";
//  End -->


(The IP-adress are replaced here for anynomous reasons, as is the
name of the destination file.)

Any help ASAP would be greatly appreciated, as I am hoping to have this
sorted out before going on holiday on Friday 17th.

Thanks in advance!

Cheers,
Terje B.





More information about the Javascript mailing list