# JavaScript Override How-To

## Site-Wide jscript's

### jscript*.js files -- to be "linked" by your site

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>`

### jscript*.php files -- to be "included" in your HTML content sent to the browser, inline.

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.

## Page-Specific jscript's

For page-specific operation, put the file under the `/includes/modules/pages/{pagename}/` folder.

### jscript*.js files -- to be "linked" by your site

NOTE: jscript_*.js files must not contain any `<script...> .... </script>` tags. They should contain ONLY the contents that are to go "between" those tags.

### jscript*.php files -- to be "included" in your HTML content sent to the browser, inline.

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.