Archived topic
Is classList.min.js required?
3 replies · Started by Ben on July 21, 2020
Hi, I notice I have the following at the bottom of all pages:
<!--[if lte IE 11]> <script type='text/javascript' src='https://www.domain.com/wp-content/themes/generatepress/js/classList.min.js'></script> <![endif]-->
So I can see this is for IE 11 and 10, but I'm not sure if its essential or what it does exactly.
Can you let me know how it's used in GP and whether it can be removed?
Thanks
Ben
Hi there,
its running this script:
https://github.com/eligrey/classList.js
Which adds support for the element.classList javascript function.
Without it some of the JS that GP uses will not work on old browsers.
You can try and remove it with this PHP Snippet:
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_script( 'generate-classlist' );
}, 100 );
Thats perfect, many thanks.
You're welcome