转换<对象>> 声明为 javascript ActiveXObject
我的代码中有以下声明:
<object id="myObject" name="myObject"
data="data:application/x-oleobject;base64,ab9qcMENN0WE41oij7hs8764yu+YEwAA2BMABB=="
classid="clsid:83A04F76-85DF-4f36-A94E-BA3465007CDA" viewastext
codebase="someAssembly.dll#version=UNKNOWN">
</object>
我想创建同一个对象的实例,但在 .js 文件内,因此我想在不需要使用标签的情况下构造此对象(如果可能的话) :
var myObject = new ActiveXObject( *Something goes here* );
I have the following declaration in my code:
<object id="myObject" name="myObject"
data="data:application/x-oleobject;base64,ab9qcMENN0WE41oij7hs8764yu+YEwAA2BMABB=="
classid="clsid:83A04F76-85DF-4f36-A94E-BA3465007CDA" viewastext
codebase="someAssembly.dll#version=UNKNOWN">
</object>
I want to create an instance of this same object, but inside a .js file, and so I'd like to construct this object without needing to use an tag (if this is even possible):
var myObject = new ActiveXObject( *Something goes here* );
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是创建新实例的方法:
如您所见,有一个可选参数
location
,您可以使用它来访问远程 ActiveX 对象,但请在此处阅读有关它的详细信息:MSDN ActiveXObject(您会发现一些信息位于文档末尾)。
This is the way to create a new instance:
As you can see there's an optional parameter
location
that you can use to access remote ActiveX objects but read details about it here:MSDN ActiveXObject (you'll find some info at the end of the document).
您只需通过 id 调用“OBJECT”即可访问它。 例如:
现在,我可以按如下方式访问它:
其中“userText”是该对象的属性。
我希望这能回答你的问题。
You can access the "OBJECT" simply by calling it by its id. For instance:
Now, I can access it as follows:
Where "userText" is a property of that object.
I hope this would answer your question.