Running Javascript files (.js)

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)?

2 Answers

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.

3

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!

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like