Your email address belongs to a school and you are eligible for a free educational premium account.
Learn more

JS - JavaScript File

What is a JS file

The JS file extension is a text file that is used in conjunction with the JavaScript programming language. When a programmer needs a specific type of function to be executed on a website page, they put the JavaScript code for that function into a JS file. A JS file has immense potential and can carry out very complex functions. However, this also means that JS files are very susceptible to viruses. It is very easy for a JS file to become infected and this circumstance makes it very important to take extra precautions if you receive a JS file from someone you don’t know and/or trust. All JS files should be scanned before they are added to your computer.

A JS file is, basically, a text file. When this type of a file is used on a website, it is usually placed in the website directory with the rest of the website files. These directory files are held on the website server. The HTML code that creates the website page then contains code to “call” the JS file into action. When the JS file is called into action, the code within the JS server file is carried out. Some of the more common actions that come from JS files are opening and closing windows, creating drop down menus and capturing information, validating form fields and even enabling rollover images.

Here's a small, but not exhaustive list of programs that can open JS documents:

  • Adobe Dreamweaver CC (Windows, Mac)
  • Adobe ColdFusion Builder 3 (Windows, Mac)
  • Microsoft Visual Studio 2013 (Windows)
  • Jetbrains IntelliJ IDEA (Windows)
  • Es-Computing EditPlus (Windows)
  • Apple Dashcode (Mac)
  • Bare Bones BBEdit 10 (Mac)
  • MacroMates TextMate (Mac)
  • Other text editors
  • Other web browsers
About
Extension JS
MIME type application/x-javascript, text/javascript
Useful links
Example Files
example.js
(707 bytes)