javascript中的ping程序? [英] A ping program in javascript?

查看:68
本文介绍了javascript中的ping程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想知道是否有可能写一个javascript,可以ping一个ip

并返回平均往返时间(喜欢dos / linux中的ping)?


问候,Egil。

解决方案

Egil Hansen写道:



我想知道是否有可能写一个javascript,可以ping一个ip
并返回平均往返时间(比如dos / linux中的ping)?

问候,Egil。



对不起,没有......除非是JS,否则不可能做到这一点主持人

(通常是浏览器,但不一定)提供了一些界面来做

吧。


< blockquote>所以,如果我想允许我的网站访问者ping服务器并获得

往返时间,我必须使用java applet?





Egil Hansen写道:

S o,如果我想允许我的网站访问者ping服务器并获得往返时间,我必须使用java applet?




Not确定Java是否允许ping请求,但是applet是否具有

正常安全设置只允许连接回服务器

带有applet的HTML文档已从。

如果你想让你的访问者使用ping,那就在

服务器上执行ping操作,只需为你的服务器端程序提供一个接口。


-


Martin Honnen
http://JavaScript.FAQTs.com/


Hi

I''m wondering if its possible to write a javascript, that can ping a ip
and return the average round trip time (like ping in dos/linux)?

Regards, Egil.

解决方案

Egil Hansen wrote:

Hi

I''m wondering if its possible to write a javascript, that can ping a ip
and return the average round trip time (like ping in dos/linux)?

Regards, Egil.


Sorry, no... JS isn''t capable of anything like this unless the host
(usually a browser, but not necessarily) provides some interface to do
it.


So, if I want to allow my website visitors to ping a server and get the
round trip time, i have to use a java applet?




Egil Hansen wrote:

So, if I want to allow my website visitors to ping a server and get the
round trip time, i have to use a java applet?



Not sure whether Java allows ping requests by now but an applet is with
normal security settings only allowed to connect back to the server the
HTML document with the applet has been loaded from.
If you want to allow your visitors to use ping the do the ping on the
server and simply provide an interface to your server-side program.

--

Martin Honnen
http://JavaScript.FAQTs.com/


这篇关于javascript中的ping程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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