简体   繁体   English

通过Javascript控制ActiveX控件

[英]Controlling ActiveX Control via Javascript

I am trying to use some software from WonderWare via ActiveX. 我正在尝试通过ActiveX使用WonderWare的某些软件。 I have gotten the object to appear, but I am want to pass some parameters to it and eliminate having to setup the object everytime. 我已经显示了该对象,但是我想向其传递一些参数,而不必每次都设置该对象。 There are two versions of the control ActiveX and .NET. 有两个版本的控件ActiveX和.NET。 I haven't gotten the .NET control to work at all, but I can get the ActiveX one / just not the parameters. 我还没有使.NET控件正常工作,但是我可以使ActiveX成为一个/而不是参数。

Here is what the manual says about it: 这是手册说明的内容:

The aaHistClientTrend control allows you to run the Wonderware Historian Client Trend program (or a functional subset) from within the Wonderware InTouch HMI software or a .NET container like Visual Basic .NET or Internet Explorer. 通过aaHistClientTrend控件,您可以从Wonderware InTouch HMI软件或Visual Studio .NET或Internet Explorer等.NET容器中运行Wonderware Historian Client Trend程序(或功能子集)。

The HTML code that I have: 我拥有的HTML代码:

<html>
<head>
<body>
   <object id="aTrend1" classid="clsid:E08609F1-58CC-11D3-B1CF-00105AA45077" viewastext="" height="100%" width="100%" />
</body>
</head>
</html>

I try to pass the parameter via: 我尝试通过以下方式传递参数:

<script language="JavaScript">
    document.aTrend1.TagPickerVisible = false; 
</script>

And it crashes internet explorer. 并且它使Internet Explorer崩溃。

EDIT : Any ideas? 编辑:有什么想法吗?

I figured out a way to do it. 我想出了一种方法。 Not sure it's the only way, but it works. 不确定这是唯一的方法,但是它可以工作。

<html>
<head>
<script>
function fxnTrend()
    {
    aTrend1.ToolBarVisible = false; 
    aTrend1.TagPickerVisible = false; 
    aTrend1.RealTimeMode = true;
    aTrend1.TimeBarVisible = false;
    aTrend1.GridVisible = false;
    }
    fxnTrend();
</script>

<body onLoad="fxnTrend()">
    <object id="aTrend1" classid="clsid:E08609F1-58CC-11D3-B1CF-00105AA45077" viewastext="" height="100%" width="100%" />
</body>
</head>
</html>

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

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