Home > Web Front-end > JS Tutorial > body text

Summary of implementation methods for calling js in js files_javascript skills

WBOY
Release: 2016-05-16 18:43:45
Original
1226 people have browsed it
Method 1:
Js_file01.js
========
Copy code The code is as follows:

//Program code
document.write("


Js_b.js
=== =====
Copy code The code is as follows:

//Program code
new_element=document.createElement("script");
new_element.setAttribute("type","text/javascript");
new_element.setAttribute("src"," Js_a.js");
document.body.appendChild(new_element);
function fun_b ()
{
Fun_a();
}


Js_a.js
= =======
Copy code The code is as follows:

//Program code
function Fun_a ()
{
alert("a");
}


Method 3:
Js_file01. js
========
Copy code The code is as follows:

//Program code
document.scripts[0].src=" Js_file02.js"
Related labels:
js
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