- This topic has 0 replies, 1 voice, and was last updated 12 years, 7 months ago by
Support. This post has been viewed 17237 times
-
AuthorPosts
-
February 3, 2014 at 4:48 pm #9999797
Support
KeymasterWhen buttons, sliders, menus, or animations on your template stop working, a JavaScript error is almost always the cause. The fastest way to find it is to open your browser’s built-in developer console — it logs every error in real time as the page loads.
- Opening the browser console
- How to read an error message
- Common errors and fixes
- Tips and tricks
- Contacting support
Opening the Browser Console
The console is part of your browser’s built-in developer tools. It shows all JavaScript errors, warnings, and messages the moment the page loads.
Google Chrome and Microsoft Edge
Both browsers share the same DevTools interface (Edge is Chromium-based, so they work identically).
Option A — Keyboard shortcut (fastest)
Press
F12on Windows/Linux, orCmd + Option + Ion Mac. Then click the Console tab if it’s not already selected.Option B — Right-click menu
Right-click anywhere on the page → click Inspect → click the Console tab.
Option C — Browser menu
Click the ⋮ menu in the top-right corner → More tools → Developer tools → Console tab.
You’ll see a panel like this — errors appear in red:
Mozilla Firefox
Option A — Keyboard shortcut
Press
F12, orCmd + Option + Ion Mac. Click the Console tab.Option B — Right-click menu
Right-click on the page → Inspect → Console tab.
Apple Safari
Safari requires enabling the developer menu once before you can use it.
Step 1 — Enable developer tools
Go to Safari → Settings → Advanced and check “Show features for web developers” (called “Show Develop menu in menu bar” on older versions).
Step 2 — Open the console
Press
Cmd + Option + C, or go to Develop → Show JavaScript Console.
How to Read an Error Message
Every console error follows the same structure. Once you know how to read it, you can immediately tell what went wrong and where.
- Uncaught — The error was not handled by any
try/catchblock in the code. - Error type — The category:
ReferenceError,TypeError,SyntaxError, etc. Each type points to a different kind of problem. - Message — A plain-English description of what went wrong (e.g.
$ is not defined,Cannot read properties of null). - File & line — The blue clickable link (e.g.
theme.js:441). Click it to open that exact line in the Sources/Debugger tab.
Important: If you see multiple errors, focus on the first one. Later errors are often caused by the first failure cascading through the page.
Common JavaScript Errors and Fixes
“$ is not defined” or “jQuery is not defined”
This is the most frequent error on HTML templates. It means jQuery is not loaded, or it’s being loaded after the scripts that depend on it.
Fix: Make sure jQuery loads first, before any other scripts in your HTML:
<!-- jQuery must come FIRST --> <script src="js/jquery.min.js"></script> <!-- Then your other scripts --> <script src="js/plugins.min.js"></script> <script src="js/theme.js"></script>
Also verify that the path to
jquery.min.jsis correct and the file actually exists on your server. If you’re loading jQuery from a CDN, check your internet connection and confirm the CDN URL hasn’t changed.“Cannot read properties of null” or “Cannot read properties of undefined”
A script is trying to access an element (a button, div, or other HTML element) that doesn’t exist on the current page, or the script is running before the page has finished loading.
Fix: Move your
<script>tags to the bottom of<body>, just before</body>, rather than in<head>. This ensures all HTML elements are ready before scripts run. Alternatively, wrap your code in a DOM ready listener:document.addEventListener('DOMContentLoaded', function() { // your code here runs after the page is ready });“X is not a function”
Something your code is treating as a function is actually
null,undefined, or a different type. Common causes: a plugin isn’t loaded, it’s loaded in the wrong order, or there’s a naming conflict between two libraries.Fix: Click the blue file:line link in the error to see exactly where the call is happening. Confirm the library or plugin that provides the function is included in your HTML and loads before the script that calls it.
“Failed to load resource” or “net::ERR_ABORTED 404”
A JavaScript or CSS file referenced in your HTML cannot be found on the server. Any functionality provided by that file will be broken.
Fix:
- Open the Network tab in DevTools (next to Console)
- Reload the page — files that failed to load appear in red
- Check the exact path in the error and compare it to what’s in your HTML
- Confirm the file was uploaded to the server and is in the correct folder
“Uncaught SyntaxError”
There is invalid JavaScript in one of your files — a typo, missing parenthesis, or an edit that broke the syntax.
Fix: Click the file:line link to see the exact line. If you recently edited that file, undo your changes. If you haven’t touched it, try re-uploading the original file from your purchase.
Tips and Tricks
- Hard refresh — A regular
F5reload can serve cached (old) scripts. Force a full reload withCtrl + Shift + Ron Windows/Linux, orCmd + Shift + Ron Mac. This clears the cache and re-downloads all files. - Try incognito / private mode — Browser extensions (ad blockers, script blockers, dev tools) can inject scripts or block resources and cause errors that aren’t actually in your template. Test in an incognito window to rule this out.
- Test in another browser — If the error only appears in one browser, it may be a browser-specific compatibility issue rather than a template bug.
- Check the Network tab for 404s — Switch to the Network tab, reload the page, and look for red rows. These are files that failed to load and are likely causing your errors.
- Right-click → Copy message — Right-click any console error to copy the full message. Paste it into a Google search — most errors have widely documented solutions.
- Focus on line 1 first — The console lists errors in the order they occur. The first error is usually the root cause. Fix it and reload — subsequent errors often disappear on their own.
Contacting Support
If you can’t resolve the issue on your own, we’re happy to help. To speed up the diagnosis, please include the following in your support request:
- The full error message exactly as it appears in the console (copy-paste, not a paraphrase)
- The URL of the page where the error occurs
- Your browser name and version (e.g. Chrome 125, Firefox 127)
- A screenshot of the Console tab showing the error in context
- Whether the issue occurs in all browsers or only one
- Any recent changes you made (file edits, plugin additions, hosting moves)
-
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.