Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've noticed that if you try and run (not edit) a Javascript file, instead of going to edit. It will come up with an error. This error normally sounds like it is missing a reference (your code, not the program running your code). I getting stuff like this:

Script: \h0700sdc01\home$\etc.

Line: 3 Char: 1

Error: 'document' is undefined'

Code: 800A1391

Source: Microsoft JScript runtime error

Is this normal? If it doesn't error, then it does nothing. My question is, is it trying to execute it like a program (similar to VBScript)?

share|improve this question
up vote 1 down vote accepted

If the javascript has references to the HTML document object model (DOM), then you will have problems running it like it is a VBScript. This is because the script is designed to perform operations on an HTML document within a web browser.

share|improve this answer
    
Are you implying that JavaScript can be run on its own? Can I run it as a separate program? If so, could you provide me with a reference on the subject (more in depth details)? Just points for now :) – Xander Lamkins Apr 28 '11 at 17:59
    
It would be possible to run javascript on it's own, however you will have to refer to Microsoft's documentation on what all javascript can/cannot do/access in the OS. Most of my familiarity with javascript is within web pages. – Justin Pearce Apr 28 '11 at 18:01
    
@XanderLamkins JS outside the browser environment is most commonly executed using the Node.js runtime: nodejs.org. – Rich Churcher Oct 13 '15 at 1:16

I have the same "error" as you. This message box is run by VBScript. This is completely normal. This is only because the operating system thinks it is a system file and tries to run it. If you want to edit it, you can select the default program to open the file. Change it from Microsoft Windows Based Script Host to notepad or a text editor. That should open it. Hope this helped!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .