[Resolved] Is classList.min.js required?

Home Forums Support [Resolved] Is classList.min.js required?

Home Forums Support Is classList.min.js required?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1370982
    Ben

    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&gt; <![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

    #1370995
    David
    Staff
    Customer Support

    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 );
    #1371041
    Ben

    Thats perfect, many thanks.

    #1371755
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.