JavaScript External Files
Link to external JavaScript libraries and files hosted on CDNs or your server.
JS External File snippets load JavaScript libraries or scripts from a remote URL, with support for defer and async loading attributes. This type is best when you need to include a third-party library from a CDN — such as jQuery, a jQuery plugin, a charting library, a heatmap tool, or any hosted script — without embedding the code directly into your snippet.
How to Create a JavaScript External Files Snippet
To learn how to load external JavaScript files in Joomla, follow the steps below:
- Log into your Joomla administrator
- Go to Components → Tassos Code Snippets
- Click New
- Enter a descriptive Title (e.g. "Load jQuery from CDN")
- Select JavaScript External File as the Code Type.
- Choose one of the following insertion locations
- Site Header
- Site Footer
- Admin Header
- Admin Footer
- Enter the URL or relative paths of the JavaScript files you want to load, one per line. Do not write any JavaScript or HTML in the editor, only plain URLs. The extension will create a
<script>tag for each URL and inject it at the chosen location.- To load an external file, start with
https://orhttp://(e.g.https://cdn.example.com/library.js) - To load local files on your server, write the path without a leading slash (e.g.
templates/mytemplate/js/library.js)
- To load an external file, start with
- In the Script Loading option select how the scripts should be loaded.
- Defer delays execution until the page is parsed.
- Async loads the script asynchronously.
- Open the Conditional Logic tab to restrict which pages or users the snippet runs on. Leave it empty to run it site-wide. Learn more in Using Snippet Logic.
- Set Status to Published and click Save & Close.
Troubleshooting
Script Not Loading
- Check URL: Verify the URL is correct and accessible
- Check HTTPS: Ensure using HTTPS, not HTTP
- Check console: Look for errors in browser console (F12)
- CORS issues: Some scripts require
crossoriginattribute - CDN availability: Verify CDN is operational
Script Loading But Not Working
- Load order: Ensure dependencies load first (check priorities)
- Timing: Script may need
deferor different location - Conflicts: Check for JavaScript conflicts in console
- Initialization: Some libraries require initialization code
Slow Page Load
- Defer loading: Use
deferorasyncattributes - Location: Move scripts to Footer
- Minimize requests: Reduce number of external files
- Use faster CDN: Switch to more reliable CDN
Last updated on Jun 6th 2026 11:06