469,342 Members | 5,849 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,342 developers. It's quick & easy.

Can javascript call a MS Windows COM object?

Hello

Can javascript call/reference COM object. VBScript can do this (as it is
from Microsoft). Can javascript? If so how?

Angus
Jan 30 '06 #1
3 6133
Angus Comber wrote:
Hello

Can javascript call/reference COM object. VBScript can do this (as it is
from Microsoft). Can javascript? If so how?

Angus


No different that VBScript, JScript can automate any COM object with
IDispatch interface. Search for Windows Scripting Host (or WSH).

However, this is subject to security rules when JavaScript is hosted in
Internet Explorer.

JavaScript (as defined in ECMA specification) cannot automate COM object.
Jan 31 '06 #2
Roman wrote:
Angus Comber wrote:
Can javascript call/reference COM object. VBScript can do this (as it is
from Microsoft). Can javascript? If so how?
[...]
No different that VBScript, JScript can automate any COM object with
IDispatch interface. Search for Windows Scripting Host (or WSH).


The Windows Script Host (formerly: Windows Scripting Host) does not have
much to do with this. Use of ActiveX/COM is not restricted to that; one
could say, unfortunately, considering the number of security leaks and
therefore, security patches for Windows systems and Internet Explorer
required because of this during the years.
However, this is subject to security rules when JavaScript is hosted in
Internet Explorer.
True.
JavaScript (as defined in ECMA specification) cannot automate COM object.


That is not quite correct. What is important in answering this question
properly is: Does the UA's AOM/DOM expose means to access ActiveX/DOM
objects, and if yes, which?

Therefore, it is incorrect to say that JavaScript cannot automate COM
objects. Netscape (all versions) on Windows can automate the ActiveX/COM
object of the Windows Media Player, and with the ActiveX Plugin installed,
all Mozilla browsers (NN4+, Gecko-based browsers) can automate probably all
ActiveX/COM objects. Of course, the scripting language they support do to
so is (Netscape) JavaScript.

BTW: Please learn to quote.
PointedEars
Jan 31 '06 #3
Roman wrote:
JavaScript (as defined in ECMA specification) cannot automate COM object.


I forgot to mention that both JavaScript 1.1 and 1.3+. and JScript are fully
compliant ECMAScript implementations, and JavaScript is not "defined in
ECMA specification".
PointedEars
Feb 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.