On this page
What this issue is
A CDN (content delivery network) is a network of servers that hosts shared files, such as jQuery, so your page can load them from a third party instead of from your own server. Many themes, plugins, form builders and page builders pull jQuery or other libraries from a CDN like cdnjs, jsDelivr, unpkg or code.jquery.com.
- Page loadsHTML and CSS render normally
- CDN requestjQuery file fails to download
- Form or menu scriptjQuery is not defined, script stops
- Lead or orderSubmit or checkout never completes
The page renders, but scripts that depend on the library stop running.
Why it costs you leads or sales
Example: illustrative numbers for a site whose form depends on a CDN-hosted jQuery file.
How to check if your site has it
Open the page and the console
Load the affected page in Chrome, press F12 and open the Console tab. Look for red errors such as 'jQuery is not defined' or '$ is not defined'.
Check the Network tab
Open Network, reload, and filter by JS. Look for rows in red, or with status 403, 404 or 5xx, or 'blocked'. Note the domain, for example cdnjs.cloudflare.com or code.jquery.com.
Find where it is loaded
View page source and search for 'jquery' and 'cdn'. Check your theme, plugins and tag manager tags too, since they can inject libraries.
Test the interactions
Submit the form, open the menu, add to cart. If they fail only when the console shows the error, the library is the cause.
Check the CDN status
Visit the CDN provider's status page to see if there is an incident, and open the script URL directly in a new tab to see if it loads.
How to fix it
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script>
window.jQuery || document.write('<script src="/js/vendor/jquery-3.7.1.min.js"><\/script>');
</script>Use the bundled jQuery
WordPress ships its own jQuery. If a theme or plugin replaces it with a CDN version via wp_deregister_script('jquery'), remove that code or check the plugin's settings for a 'load jQuery from CDN' option and turn it off.
Self-host other libraries
Download the file, upload it to your theme or child theme, and enqueue it with wp_enqueue_script using a local path.
Upload the file as an asset
In Online Store > Themes > Edit code, add the library under Assets and reference it with {{ 'jquery.min.js' | asset_url | script_tag }} in theme.liquid.
Replace CDN tags
Search theme.liquid and section files for cdn links and swap them for the asset reference.
Find Custom HTML tags that load libraries
Open Tags and search for 'cdn' or 'jquery'. Replace external URLs with a copy on your own domain.
Avoid depending on page jQuery
Where you can, write tag code in plain JavaScript so it works even if jQuery fails.
Check project settings
Webflow includes jQuery by default. In Project settings > Custom code, look for extra CDN script tags and host your own files if needed.
Add a fallback
Paste the fallback snippet in the Footer code area, pointing to a file you host elsewhere.
Review custom code
In Settings > Custom code, check for CDN script tags and remove those you don't need. Wix manages its own core libraries, so you can't replace those.
Check Code Injection
Open Settings > Advanced > Code Injection and look for CDN script tags. Upload files through the file storage and link to them from there, or remove the dependency.
Install via a package manager
Add the library with npm and bundle it into your own JavaScript so it ships from your domain.
Pin versions
Use an exact version in the URL, not 'latest', so an upstream change can't break the page.
Before
- jQuery loads only from a third-party CDN
- CDN down means forms and menus fail
- No one notices until leads drop
After
- Library served from your own domain or with a local fallback
- Page keeps working if the CDN fails
- Console errors are monitored
How to confirm it's fixed
- The console shows no 'jQuery is not defined' errors after a hard reload
- The Network tab shows the library loading with status 200
- Block the CDN domain in DevTools (Network request blocking) and confirm the page still works through the fallback
- The form submits and the lead reaches your inbox or CRM
- Menus, popups and add-to-cart work on mobile and desktop
How to prevent it happening again
- Self-host libraries that forms, checkout or tracking depend on
- Pin exact library versions
- Keep a local fallback for any CDN script you retain
- Remove scripts no longer used by your theme or plugins
- Re-test key journeys after theme, plugin or tag changes
- Monitor key pages for console errors
How FunnelGuard handles this
Frequently asked questions
Questions people ask
Why is my form not working when the page looks normal?
A script the form depends on may have failed to load, for example jQuery from a CDN. Open the browser console and look for 'jQuery is not defined' or red failed requests in the Network tab. If you see them, the library is the cause.
What does 'jQuery is not defined' mean?
It means code tried to use jQuery before it was loaded, or the jQuery file never loaded at all. Common causes are a CDN outage, a blocked or wrong URL, a bad SRI hash, or scripts loading in the wrong order.
How do I add a fallback if the jQuery CDN fails?
After the CDN script tag, add a small script that checks window.jQuery and, if it is missing, writes a script tag pointing to a copy on your own server. This keeps the page working when the CDN is down.
Should I self-host jQuery or use a CDN?
For scripts that forms, checkout or tracking depend on, self-hosting is safer because you control availability. A CDN can be faster, but only use one with a local fallback.
How can I tell if a CDN is down?
Open the script URL directly in your browser and check the provider's status page. Also test from another network, because outages can be regional.
Can a CDN outage affect my ad tracking?
Yes. If your tracking or event code relies on a library that fails to load, conversion events may not fire, so ad platforms get less data until it is fixed.
How can I be alerted when a library fails to load?
Use monitoring that runs your real journeys and reports console errors. FunnelGuard does this on a schedule and sends one alert with a screenshot and a likely cause after re-checking from a second region.
Related issues
- OPS-219Google Fonts / font CDN outage (invisible text)Fix guide
- OPS-231Analytics/GTM endpoint blocked or downFix guide
- OPS-215Typeform/Jotform/HubSpot form embed outageFix guide
- OPS-222reCAPTCHA/hCaptcha service outageFix guide
- OPS-233Third-party status changes not correlated with incidentsFix guide
- OPS-223Video host (Vimeo/Wistia/YouTube) VSL won't playFix guide