Any file in the includes/templates/{template_directory}/jscript/
directory with the following filename format will be loaded globally on every page of your shop:
jscript_{unique_name}.js
(where {unique_name} can be anything you want)
Effectively, the file will be loaded as if you had inserted the following into an HTML page:
<script language="javascript" src="includes/templates/{template_directory}/jscript/jscript_{unique_name}.js"></script>
If you need to control the content of certain PHP variables inside jscript code on the page, OR if you need to include several <script>...</script> tags, use a jscript_*.php file instead.
However, in this case, you DO need to include the <script .... > and </script> tags in the file.
For page-specific operation, put the file under the /includes/modules/pages/{pagename}/
folder.
NOTE: jscript_*.js files must not contain any <script...> .... </script>
tags. They should contain ONLY the contents that are to go "between" those tags.
If you need to control the content of certain PHP variables inside jscript code on the page, use a jscript_*.php file.
However, in this case, you DO need to include the <script .... > and </script> tags in the file.