使用 Javascript/Jquery 获取计算机名称 [英] Get the Computer Name Using Javascript/Jquery

查看:33
本文介绍了使用 Javascript/Jquery 获取计算机名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 jquery 获取计算机名称.我尝试使用 ActiveX 对象,但它只能在 IE 浏览器上运行.有没有另一种方法可以使用 jquery 获取计算机名称.我试过那个代码.

I want to get the computer name using jquery. I tried using ActiveX Object but it will only run on IE browser. Is there is another way to get the computer name using jquery. I tried that code.

 var network = new ActiveXObject('WScript.Network');  
 alert(network.computerName); 

谁能帮帮我..

推荐答案

你不能.网站无法获得此信息.

You can't. This information is not available to web sites.

您问题中概述的 ActiveX 方法在当前版本的 Internet Explorer 中甚至不起作用,因为 WScript.Network ActiveX 对象未标记为安全的脚本.

The ActiveX approach outlined in your question won't even work in current versions of Internet Explorer, as the WScript.Network ActiveX object is not marked as safe for scripting.

这篇关于使用 Javascript/Jquery 获取计算机名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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