Home > Web Front-end > JS Tutorial > A small script to load js files_javascript skills

A small script to load js files_javascript skills

WBOY
Release: 2016-05-16 19:12:00
Original
932 people have browsed it
Copy code The code is as follows:

// Replace the path below with the path where your js file is located.
$js_path = "http://www.soojs.com/js/";

function js_include($script){
var script = document.createElement('script');
script.src = $js_path $script;
script.type = 'text/javascript';
var head = document.getElementsByTagName('head').item(0);
head.appendChild (script);
}

//Change the question to your file
js_include("prototype.js");
js_include("scriptaculous.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