• Resolved joy0114

    (@joy0114)


    Hi,

    With last release, I’ve got a js error when pages are loading.
    I use Hustle plugin for displaying the newsletter form which transmit data to mailerlite. I don’t use the form from mailerlite plugin.

    Issue is in /woo-mailerlite/public/js/public.js:

    jQuery(document).ready(function(a) {
        const allowedInputs = ['billing_email', 'billing_first_name', 'billing_last_name', 'woo_ml_subscribe'];
        triggerAddEvents();
        var execute;
        if (jQuery('#woo_ml_preselect_enabled')?.val() == 'yes') {
            jQuery('#woo_ml_subscribe').prop('checked', true);
        }
    
        function triggerAddEvents() {
            const email = document.querySelector('#billing_email');
            const first_name_field = document.querySelector('#billing_first_name');
            const last_name_field = document.querySelector('#billing_last_name');
            const signup = document.querySelector('#woo_ml_subscribe');
            if (!email.form.querySelector('#woo_ml_subscribe')) { .......................
            .............................................................................

    And error message is:

    jQuery.Deferred exception: Cannot read properties of null (reading 'form') TypeError: Cannot read properties of null (reading 'form')
        at triggerAddEvents

    and:

    Uncaught TypeError: Cannot read properties of null (reading 'form')
        at triggerAddEvents

    Thanks for any solution !
    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘JS error’ is closed to new replies.