Set Up My JScript Project

 

To call XML DOM APIs from a JScript application, first you need to make sure that MSXML is installed on your machine. See Get Ready to Work with MSXML for instructions on how to install MSXML.

Next, you need a text editor, such as Notepad, to create JScript files.

You can run the JScript in a Web browser, such as Microsoft Internet Explorer. Alternatively, you can use Windows Scripting Host, which is preinstalled in Widows 2000 and Windows XP. In this tutorial, we use Windows Scripting Host.

To create a JScript project

  1. Create a folder to hold the project.

  2. Launch Microsoft Notepad or your favorite text editor.

  3. Type in your JScript code. In this tutorial you will copy and paste the code.

  4. Save the code to a file in the chosen folder.

To run a JScript project

  1. Select Run from the Start menu and type in "cmd" to open a Windows command prompt.

  2. Type "cd JScriptProj", where "JScriptProj" is the path to a JScript Project folder where you have created the JScript files and required resource files.

  3. Type "cscript MyJScript.js", where "MyJScript.js" is the JScript file you wish to run.

To run a JScript project using Windows XP

  1. Use Windows explorer, and navigate to the directory where you have created the JScript files and the required resource files.

  2. Double click on "MyJScript.js", where "MyJScript.js" is the JScript file you wish to run.

Now, we'll look at how to instantiate an XML DOM object.