Home > Web Front-end > JS Tutorial > What does src mean in javascript

What does src mean in javascript

醉折花枝作酒筹
Release: 2021-07-16 11:48:51
Original
13357 people have browsed it

The src in JavaScript is: 1. Specify the attribute of the language in which the browser interprets the script code; 2. Specify the language in which the browser interprets the script code; 3. Specify the file where the script is located, and pass the content after src to Server; 4. Specify the size of the script.

What does src mean in javascript

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

What is the role of the src attribute in JavaScript language?

Specify the properties of the language in which the browser interprets the script code, specify the language in which the browser interprets the script code, specify the file where the script is located, and specify the size of the script.

Specify the file where the script is located, which represents the js file you imported. However, this function is mainly for cross-domain or other purposes, mainly to pass the content behind your src to the server.

src is the abbreviation of the word source, indicating the source file path. Commonly used ones are

<script src="路径"></script>
<img src="路径">/script>
Copy after login

JS files are not HTM files, so there cannot be HTML tags inside (except for the HTML tags included in the Output statement) .

Even though it is possible to use the <script> tag in the JS file, since the JS file itself is called by the <script src="..."> tag, this will become a duplicate tag, which is a negative for the snake drawing of supplement. </p> <p>JS is a script file and consists of script code. Essentially, the normal <script> and </script> tags between the lines of code are cut into a new file that is a JS file, and the filename is then put into the script's SRC attribute.

[Recommended learning: javascript advanced tutorial]

The above is the detailed content of What does src mean in javascript. 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