Loading two versions of same JS libary

Currently migrating from an older version of a JS library (sweetAlerts), to a newer version.

Both versions load, but I want to be able to use the updated library, but unsure how to reference it in JavaScript to use the newer library. Any input on how to do this would be appreciated.

wp_enqueue_script( ‘sweet-alert’, plugin_dir_url( __FILE__ ) . ‘js/sweetalert.min.js’, array(), $this->version, false );
wp_enqueue_script( ‘sweet-alert-latest’, plugin_dir_url( __FILE__ ) . ‘js/sweetalert-latest.min.js’, array(), $this->version, false );

Read more here:: Loading two versions of same JS libary

Leave a Reply

Your email address will not be published. Required fields are marked *