JavaScript (also called JS) is a coding language that allows content to be dynamically updated and rendered on a web page. It’s a vital part of the look and experience of a WooCommerce site.
The Stripe WooCommerce Extension leverages JavaScript to display important aspects of the payment process for customers — like displaying payment fields. If a customer sees an error requesting that they enable JavaScript, then it’s likely either a result of:
- JavaScript errors on the checkout page.
- JavaScript files fail to load on the checkout page.
What can cause issues when loading JavaScript files?
↑ Back to topThe Stripe WooCommerce Extension requires JavaScript files to function. If these are not loaded properly, it will produce errors. The most common reasons for JavaScript files not loading are:
- The active theme is missing
wp_head()
orwp_footer()
calls. - The active theme is using old, overridden template files.
- You can read more about fixing outdated templates here.
- The active theme is loading headers and/or footers in a non-standard way.
- WooCommerce uses
get_header()
’sget_header
action to initialize the checkout and load scripts. If you are not usingget_header()
, you either:- Need to do so.
- Need to trigger the
get_header
action manually usingdo_action( ‘get_header' );
in your custom header loader.
- WooCommerce uses
- An optimization plugin is preventing the JavaScript files from loading properly.
How can I test what is preventing the JavaScript files from loading?
↑ Back to topIf 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.