How is the .js extension file created that is used by the browser when opening web pages?

0

How is the .js extension file created that is used by the browser when opening web pages?

I am studying a website already created to understand the system of functioning of the sites. In the archives of this site, when saving the complete webpage, I can find some .js files, and I would like to understand how it is created. Can anyone help me with this?

Second question: What is the language name of this file?

Third question: Can this file be created with DreamWeaver?

    
asked by anonymous 04.07.2017 / 22:25

1 answer

2

JS is the extension for JavaScript

And yes you can create JS files using any text editor (DreamWeaver, Sublime, Atom, VIM, Notepad, etc.)

And for .JS files to be called on a page the simplest way is to create an .JS file example: file.js

And then in your index.html you can call it that way here

<script src="arquivo.js"></script>

And then your html looks something like

<!DOCTYPE html>
<html>
    <head>
        <script src="arquivo.js"></script>
    </head>
    <body> 
        <h1>Oi Mundo</h1>
    </body>
</html>

NOTE: Remember that for this to work your .js file and its index.html must be in the root of the same folder.

    
04.07.2017 / 22:36