JavaScript is a programming language that allows websites to be dynamically rendered and updated. It’s a vital part of the look and functionality of a WooCommerce site.
Our Stripe extension uses JavaScript to display important parts of the checkout flow to customers, such as payment form fields. If a customer sees an error requesting that they enable JavaScript, it’s likely a result of:
- JavaScript errors occurring on the checkout page, or…
- JavaScript files failing to load on the checkout page
What can cause these issues?
↑ Back to topThe most common reasons for JavaScript errors are:
- An optimization plugin is preventing the JavaScript files from loading properly
- The active theme is missing calls to
wp_head()
and/orwp_footer()
- The active theme is using old, overridden template files
- You can read more about fixing outdated template files here
- The active theme is loading headers and/or footers in a non-standard way.
- WooCommerce uses the
get_header
action inside ofget_header()
to initialize the checkout and load scripts. If your current theme is not utilizingget_header()
, you must either:- Switch to use
get_header()
, or… - Trigger the
get_header
action manually usingdo_action( ‘get_header' );
in your custom header loader.
- Switch to use
- WooCommerce uses the
If you’d like to determine what is causing the JavaScript files to not load properly on your site, you will want to perform a conflict test. You can read more about plugin and theme conflicts in our Self-Service Guide.