Book a Demo

Author Topic: JSscript vs JavaScript  (Read 4373 times)

lubos

  • EA User
  • **
  • Posts: 101
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
JSscript vs JavaScript
« on: October 21, 2009, 10:09:33 pm »
Hi,
this line is valid in Scripter for JScript

var xmlDOM = new ActiveXObject( "MSXML2.DOMDocument.4.0" );

but it's not valid for JavaScript.
What I have to write to use any COM object using JavaScript?
Thanks for any hint.

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • ArenĀ“t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: JSscript vs JavaScript
« Reply #1 on: October 23, 2009, 12:26:54 am »
You can't.
JScript uses the Windows scripting engine which enables access to ActiveX and COM.
JAVAScript does not.

Oliver

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: JSscript vs JavaScript
« Reply #2 on: October 23, 2009, 04:59:22 pm »
Oliver is correct that it is not supported natively by JavaScript. We do provide a COM wrapper library though that is accessible from JavaScripts within the EA JavaScript engine.

To create a COM object, the syntax for named objects is:

Code: [Select]
var obj = new COMObject("WMPlayer.OCX");
or for ClsIDs

Code: [Select]
var obj = new COMObject("{6BF52A4F-394A-11D3-B153-00C04F79FAA6}");
Please note the curly braces ({}) are required for ClsIDs.
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8