简体   繁体   English

使用 Javascript/Jquery 获取计算机名称

[英]Get the Computer Name Using Javascript/Jquery

I want to get the computer name using jquery.我想使用 jquery 获取计算机名称。 I tried using ActiveX Object but it will only run on IE browser.我尝试使用 ActiveX 对象,但它只能在 IE 浏览器上运行。 Is there is another way to get the computer name using jquery.有没有另一种方法可以使用 jquery 获取计算机名称。 I tried that code.我试过那个代码。

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

Can u any one help me..谁能帮帮我..

You can't.你不能。 This information is not available to web sites.该信息不可用于网站。

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

Is there is another way to get the computer name有没有另一种方法来获取计算机名称

You can utilize NativeMessaging to achieve requirement at Firefox and Chromium, Chrome.您可以利用NativeMessaging来实现 Firefox 和 Chromium、Chrome 的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM