Support » Plugin: Official MailerLite Sign Up Forms » JQuery not defined with WP Rocket Plugin

  • Resolved Salar Gholizadeh


    Hi. there is an issu with inline javascript which is caused when the JQuery is deffered. you can fix this by replacing the inline script tag on

    with this one:

    <script type=”text/javascript”>
    window.addEventListener(“load”,function(event) {
    var jQuery = window.jQueryWP || window.jQuery;
    var form_container = jQuery(“#mailerlite-form_<?php echo $form_id; ?>[data-temp-id=<?php echo $unique_id; ?>] form”);
    form_container.submit(function (e) {
    submitHandler: function (form) {

    jQuery(this.submitButton).prop(‘disabled’, true);

    form_container.find(‘.mailerlite-subscribe-button-container’).fadeOut(function () {

    var data = jQuery(form).serialize();‘<?php echo admin_url( ‘admin-ajax.php’ ); ?>’, data, function (response) {
    form_container.find(‘.mailerlite-form-inputs’).fadeOut(function () {


Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Salar,

    Please can you tel me the full path to this file,

    I’ve looked around but cant seem to find it.

    Thanks in advance.


    Thread Starter Salar Gholizadeh


    @mailerlite any updates on this? this codes makes mailerlite compatible with deffering js scripts which is commonly used in script optimizing. currently I have to edit this everytime I update the plugin.

    @furnituresuppliesuk sorry for my late late reply! the path, as I mensioned, is this:

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘JQuery not defined with WP Rocket Plugin’ is closed to new replies.