Get the Computer Name Using Javascript/Jquery

試著忘記壹切 提交于 2021-02-05 08:30:50

问题


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); 

Can u any one help me..


回答1:


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.




回答2:


Is there is another way to get the computer name

You can utilize NativeMessaging to achieve requirement at Firefox and Chromium, Chrome.



来源:https://stackoverflow.com/questions/46658359/get-the-computer-name-using-javascript-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!