I am trying to get system information. I found a script. When i tried it, it is working in internet explorer. But it is not working with mozilla.
I think problem is with below statement as activeX might not work with mozilla.
Expand|Select|Wrap|Line Numbers
- var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
Here is the script:
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET
7.1">
<meta name="vs_targetSchema" content="http://
schemas.microsoft.com/intellisense/ie5">
<script id="clientEventHandlersJS" language="javascript">
<!--
function Button1_onclick() {
var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery("SELECT * FROM Win32_OnBoardDevice");
var e = new Enumerator (properties);
document.write("<table border=1>");
dispHeading();
for (;!e.atEnd();e.moveNext ())
{
var p = e.item ();
document.write("<tr>");
document.write("<td>" + p.DeviceType + "</td>");
document.write("<td>" + p.Description + "</td>");
document.write("<td>" + p.Enabled + "</td>");
document.write("<td>" + p.Tag + "</td>");
document.write("</tr>");
}
document.write("</table>");
}
function dispHeading()
{
document.write("<thead>");
document.write("<td>DeviceType</td>");
document.write("<td>Description</td>");
document.write("<td>Enabled</td>");
document.write("<td>Tag</td>");
document.write("</thead>");
}
//-->
</script>
</head>
<body>
<INPUT id="Button1" type="button" value="Button"
name="Button1" language="javascript" onclick="return Button1_onclick()">
</body>
</html>[/HTML]