»
EnglishFrenchVietnamese

Print - JavaScript Includes - JavaScriptBank.com

Full version: jsB@nk » Snippet » JavaScript Includes
URL: https://www.javascriptbank.com/javascript-includes.html

JavaScript Includes © JavaScriptBank.comWhen you start using Prototype, Scriptaculous, and other JavaScript libraries, you often end up with a dozen lines of script tags pulling in all of the code from different places. That would be fine if you never added a new library or never needed to swapped them out. This JavaScript will create a single JavaScript loader for each project that contains all of the scripts necessary.

Full version: jsB@nk » Snippet » JavaScript Includes
URL: https://www.javascriptbank.com/javascript-includes.html



JavaScript
<script type="text/javascript">// Created by: J Wynia. | http://www.wynia.org/ */// Change the domain and path below to match where your scripts are kept.$js_path = "http://www.yourPath.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);}// Enter the script files herejs_include("prototype.js");js_include("scriptaculous.js");</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->