• Resolved MB-Jan

    (@mb-jan)


    Hey Raul,

    I initially thought that jQuery was being moved to the footer, even though I excluded it from being optimized. This was wrong. Instead it is still in the header, but at a different position.

    When being logged in and the optimization is inactive, jquery and jquery-migrate are being loaded before frm.min.js. (all three scripts have been excluded from optimization).
    However, when being logged out and your awesome plugin kicks in, jquery and jquery-migrate is loaded after frm.min.js, which breaks functionality.

    I checked in the code and frm.min.js (from Formadible Forms) is being enqueued with jquery as a requirement.

    Is there anything I can do to force the order to remain unchanged?

    Thank you for your help.

    – Jan

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Raul P.

    (@alignak)

    Hi,

    This is a bit strange.

    As long as frm.min.js is being enqueued properly, it should come out properly?
    http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/

    I briefly looked into their code, and their file is included like this:
    add_action( 'init', 'FrmFormsController::front_head' );

    The init hook is too early for FVM to catch (and init should never be used to enqueue js or css files). I suggest asking the formidable forms developer to change it to the standard wp_enqueue_scripts hook.

    Meanwhile, what you could do is to manually dequeue it from init, and requeue it on wp_enqueue_scripts via your functions.php file… but this is a bit hackish.

    I’ll do some testing in the future, to see if I can somehow, grab these edge cases.

Viewing 1 replies (of 1 total)

The topic ‘jQuery Position’ is closed to new replies.