[Javascript] Browser-problem, again...

Rees, Mark (TWIi London) mrees at twii.net
Fri Aug 17 06:06:57 CDT 2001


Hello

http://www.flupdiwup.de/wissen/source/javascript/b4txt.html

if you speak German, this page tells you that getting the IP address using
Javascript is not possible in IE

Cheers

Mark

-----Original Message-----
From: Terje Bremnes [mailto:terjeb at ii.uib.no]
Sent: 17 August 2001 07:30
To: javascript at latech.edu
Subject: [Javascript] Browser-problem, again...


Hi,

I posted this some days ago but have yet to receive a reply from anyone.
As this is getting to be an annoying little problem now, I post it to
you guys again, hoping that someone will take the challenge of helping
me out!

Here´s the 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.)

Hoping for help soon as I was hoping to have this worked out before going
to Greece on holiday tomorrow.

Cheers,
Terje B.


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list