By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

Can javascript call a MS Windows COM object?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.