Getting Up For JavaScript

In order for your computer to run JavaScript in a shell, you will need two pieces of software:

While any plain-text editor will work and any JavaScript interpreter will work, the CS 105 staff will support our recommended set of tools. You will see these tools are the ones that we will use in labs and lecture.

CITES Lab Computers

  1. Launch Notepad++ by going Start -> All Programs -> Word Processing -> Notepad++
  2. Download the JavaScript interpreter:
  3. Go to your Downloads folder and right click the js.zip file and press Extract All.... This will create a new js folder.
  4. Move the js folder to your desktop (not the zip file, but the folder)
  5. For any JavaScript code you want to run inside the JavaScript interpreter:
    • Copy the JavaScript file (.js) into the js directory on your desktop
    • Open the JavaScript file that is inside your js folder on your desktop with Notepad++
    • Program!
  6. To actually run the JavaScript:
    • Press [Windows Key]+R to bring up the "Run..." dialog
    • Type "cmd" (without the quotes) and press "OK"
    • Inside of the black "Command Prompt", type "cd Desktop" (without the quotes) and press enter
    • Still inside the command prompt, type "cd js" and press enter
    • Finally, type "js program.js", where program.js is the name of the JavaScript you want to run, and press enter
    • Once you have run the program once, you ran re-run it my using the up arrow and pressing enter to run the same command again

Winodws-Based Computers

  1. Download Notepad++, a plain-text editor
  2. Install Notepad++
  3. Download the JavaScript interpreter:
  4. Go to your Downloads folder and right click the js.zip file and press Extract All.... This will create a new js folder.
  5. Move the js folder to your desktop (not the zip file, but the folder)
  6. For any JavaScript code you want to run inside the JavaScript interpreter:
    • Copy the JavaScript file (.js) into the js directory on your desktop
    • Open the JavaScript file that is inside your js folder on your desktop with Notepad++
    • Program!
  7. To actually run the JavaScript:
    • Press [Windows Key]+R to bring up the "Run..." dialog
    • Type "cmd" (without the quotes) and press "OK"
    • Inside of the black "Command Prompt", type "cd Desktop" (without the quotes) and press enter
    • Still inside the command prompt, type "cd js" and press enter
    • Finally, type "js program.js", where program.js is the name of the JavaScript you want to run, and press enter
    • Once you have run the program once, you ran re-run it my using the up arrow and pressing enter to run the same command again

OS X Based Macs

  1. Download TextWrangler, a plain-text editor
  2. Install TextWrangler
  3. Download the JavaScript interpreter:
  4. Go to your Downloads folder and double click the js.zip file to extract it. This will create a new js folder.
  5. Move the js folder to your desktop (not the zip file, but the folder)
  6. For any JavaScript code you want to run inside the JavaScript interpreter:
    • Copy the JavaScript file (.js) into the js directory on your desktop
    • Open the JavaScript file that is inside your js folder on your desktop with TextWrangler
    • Program!
  7. To actually run the JavaScript:
    • Click on your tray icon to enter Launchpad
    • Type "Terminal" on your keyboard and select the Termianl app
    • Inside of the Terminal window, type "cd Desktop" (without the quotes) and press enter
    • Still inside the Terminal window, type "cd js" and press enter
    • Finally, type "./js program.js", where program.js is the name of the JavaScript you want to run, and press enter
    • Once you have run the program once, you ran re-run it my using the up arrow and pressing enter to run the same command again