Re: How to get IP address in Javascript?
Rex wrote on 30 jun 2006 in comp.lang.javascript:
Hi all,
I need to get the IP address of client machines
from inside Mozilla, Netscape, and IE.
Many webpages say to use in Netscape 4+
the expression
var ip = java.net.getLocalhost.getIpAddress()
That is java, not javascript
This for me always returns 127.0.0.1.
·. and indeed that is usually the ip of the localhost.
Is this a bug or should I get trying to retrieve
an array of addresses and then scan that?
The client IP adress is only available to the server
and to serverside code, I think,
and not to the client and it's code.
So using serverside j[ava]script under ASP it is simple:
<%
response.write(request.servervariables("remote_addr"));
%>
But then, the IP address is sometimes/usually not the machine address,
but the nat-router or the proxy address.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.
Relevant Pages
- Re: Sending an alert message to logon user in Web Application
... As for your question on let the online user in the web application notify ... mode in which the client has no persistent connection with the serverside. ... So if we need to store the message info at the serverside. ... Here is the related reference on DHTML webservice in MSDN: ... (microsoft.public.dotnet.framework.aspnet) - RE: Async Programming in asp .Net page as Windows Forms
... As for the async processing in ASP.NET you mentioned,here are my ... applicationswhich is request/response based, ... response content back to client. ... there is not relation with the serverside. ... (microsoft.public.dotnet.framework.aspnet) - Re: GPO not launching login script successfully on client machines. 3/22/2004 8:23 AM PST
... Disable Portfast on the switch. ... 202840 A Client Connected to an Ethernet Switch May Receive Several ... Disable Media Sense on the client machines: ... Make sure the DHCP assigned DNS servers list only your internal DNS servers ... (microsoft.public.win2000.group_policy) - Re: System.Net.WebClient.DownloadFile doesnt work with http attachments
... Yes, I know the serverside code won't have big difference, nor does the ... Here is the client code I've used to test, ... Microsoft Online Support ... "How to receive that pdf file at the client side?" ... (microsoft.public.dotnet.languages.csharp) - Re: Debian replicator boot disk problem
... I can connect from an other client in the LAN 192.16.0.12 pretty good. ... say: yes 100% serverside. ... The Clienet is about a 1,44MB Floppy with a realy small kernel on it ... (comp.os.linux.misc) |
|