Home > Web Front-end > JS Tutorial > How to reference dependent js files in javascript files_javascript tips

How to reference dependent js files in javascript files_javascript tips

WBOY
Release: 2016-05-16 16:55:19
Original
1076 people have browsed it

If you need to introduce other dependent js files in a js file, you only need to import the following code in the first js file:

Copy code The code is as follows:

var s=document.createElement("script");
s.src="/script/Map.js";
document .getElementsByTagName( "HEAD")[0].appendChild(s);

The red part is the path of the dependent js file.
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