使用JavaScript获取IP地址 [英] Grab IP Address with JavaScript

查看:75
本文介绍了使用JavaScript获取IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在htm

页面中使用JavaScript获取客户端IP地址?我有一个非ASP服务器托管的网页,我想在JavaScript中使用一段

代码来获取客户端的IP地址并将其发送到网页

另一台服务器上的页面。另一页将是ASP。


我需要为Netscape和IE浏览器使用它。


任何想法?

解决方案

就我个人而言,我不知道。尝试在客户端组中询问,例如

..scripting.jscript。


雷在工作


Larry R. Baker <磅**** @ eaglestrike.net>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

是吗可以在htm
页面中使用JavaScript获取客户端IP地址吗?我有一个托管在非ASP服务器上的网页,我想在JavaScript中使用一段代码来获取客户端的IP地址并将其发送到另一台服务器上的
网页。另一页将是ASP。

Netscape和IE浏览器都需要这个。

任何想法?



>是否可以在htm

页面中使用JavaScript获取客户端IP地址?我有一个托管在非ASP服务器上的网页,我想在JavaScript中使用一段代码来获取客户端的IP地址并将其发送到另一台服务器上的
网页。另一页将是ASP。




关闭主题,但是,它是可能的,但你需要的不仅仅是Javascript。我们使用Java Applet在这里做了
。我们使用受信任的applet获取IP,然后使用Javascript将
写入cookie。


托管该服务器的服务器asp页面可以从

request.servervariables(" remote_addr")获取IP地址。当然,如果客户端机器在防火墙后面是
,则客户端解析的IP将是不同的。但是

除非重要,让服务器去做。


Ray在工作


" Larry R贝克 <磅**** @ eaglestrike.net>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

是吗可以在htm
页面中使用JavaScript获取客户端IP地址吗?我有一个托管在非ASP服务器上的网页,我想在JavaScript中使用一段代码来获取客户端的IP地址并将其发送到另一台服务器上的
网页。另一页将是ASP。

Netscape和IE浏览器都需要这个。

任何想法?



Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web
page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?

解决方案

Personally, I don''t know. Try asking in a client-side group such as
..scripting.jscript.

Ray at work

"Larry R. Baker" <lb****@eaglestrike.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?



> Is it possible to grab a client side IP Address using JavaScript in an htm

page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.



Off topic, but yes, it''s possible but you need more than Javascript. We do
it here using a Java Applet. We grab the IP with the trusted applet, then
using Javascript we write it to a cookie.


The server that''s hosting the asp page can get the IP address from the
request.servervariables("remote_addr"). Of course, if the client machine is
behind a firewall, the client-side resolved IP would be different. But
unless that matters, let the server do it.

Ray at work

"Larry R. Baker" <lb****@eaglestrike.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?



这篇关于使用JavaScript获取IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆