Home > Web Front-end > JS Tutorial > What is the JavaScript suffix?

What is the JavaScript suffix?

醉折花枝作酒筹
Release: 2021-06-10 16:01:49
Original
4989 people have browsed it

In JavaScript, the suffix is ​​usually ".js", but not necessarily "" in dynamic websites. The file name here can be arbitrarily specified with a suffix. If you change it to another suffix, you can also use js normally. document.

What is the JavaScript suffix?

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

In fact, this file with the extension .js is a javascript file. Why should we use the format of to call the file? In fact, we often use In the process of making a web page, if the js file is written into the web page, it is not conducive to our repeated modifications. If we need to modify the js file in the future, we can directly change the js file without changing the entire web page. Now everyone's website is generated Static HTML is a good choice if you want to modify thousands of static pages, whether it is to replace or to save website space.

It should be noted that our js file can only contain js syntax, not simple text.

On a dynamic website, it is not necessarily the case, , the file name here can specify any suffix name.

For example:

aa.js can be changed to aa.gif and can be called normally

<script src="aa.gif"></script>
Copy after login

[Recommended learning: javascript advanced tutorial]

The above is the detailed content of What is the JavaScript suffix?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template