Home > Article > Web Front-end > Steps to write COM components in JavaScript_javascript tips
Scripting languages that support these interfaces include: JavaScript/JScript, VBScript, Perl and Python, etc.
WSC has the following characteristics.
Ø Small and efficient;
Ø Easy to create, maintain and deploy;
Ø Provides the ability to create COM components;
Ø Provides the ability to access a large number of system services.
The core work of writing COM components in JavaScript is to complete a .wsc (Windows Scripting Component) file. The .wsc file is a standard XML file with the following format:
progid ="Program ID"
version="Version number"
classid="Type ID" remotable="true">
]]>
The entire .wsc file consists of component declaration, method and attribute declaration, method and attribute description, method implementation, etc. The process of writing COM components using scripting languages such as VBScript or JavaScript is the process of completing the .wsc file. Note: The execution performance of COM components written using scripting languages such as VBScript or JavaScript cannot be compared with COM using executable binary files such as .dll and .ocx as carriers. Because scripting languages cannot be compiled, but can only run on the host. The scripting host on the Windows platform is WSH (Windows Scripting Host), which is WINDOWSsystem32scrobj.dll. Calling a COM component written in a scripting language is actually a process of directly calling WSH and then having WSH execute the script program.