Home >Web Front-end >Front-end Q&A >What is the extension of javascript document

What is the extension of javascript document

青灯夜游
青灯夜游Original
2021-10-18 17:27:126297browse

The javascript document is a text file used to install javascript code. The extension is ".js", which means that the text file is a JavaScript type file and can be edited using any text editor.

What is the extension of javascript document

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

JavaScript programs can not only be placed directly in HTML documents, but also in JavaScript script files. JavaScript script files are text files with the extension .js, which means that the text file is a JavaScript type file and can be edited using any text editor.

JavaScript files cannot run independently and need to be imported into the web page and executed through the browser. JavaScript files can be imported using the 3f1c4e4b6b16bbbd69b2ee476dc4f83a tag.

3f1c4e4b6b16bbbd69b2ee476dc4f83a tag needs to define the src attribute, and set the attribute value to the URL string pointing to the external JavaScript file. The code is as follows:

<script type="text/javascript" src="test.js"></script>

Note: When using the <script> tag to include external JavaScript files, the default file type is Javascript. Therefore, regardless of whether the loaded file has a .js extension or not, the browser will parse it as a JavaScript script. </script>

[Recommended learning: javascript advanced tutorial]

The above is the detailed content of What is the extension of javascript document. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn