• After I upgraded W3TC plugin to 0.9.5 and 0.9.5.1 my site is broken.

    This is the errors that cause the disfunction in some areas:
    – Uncaught ReferenceError: jQuery is not defined
    – Uncaught TypeError: Cannot read property ‘fn’ of undefined

    My carroussel is broken and some other areas.

    How can I solve this without disabling W3TC?

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Ramanan

    (@superpoincare)

    Have you chosen automatic minify of JS and used async/defer?

    Some plugins such as Jetpack inline some JS so this causes dependency issues.

    If that’s the case you have to block the JS in head.

    Thread Starter andre.maldonado

    (@andremaldonado)

    I’ve tried to block JS in the head but didn’t work.

    Any other suggestion?

    Thank you.

    JQuery being undefined is when you have a resource like your carousel that is saying hello jquery i need to borrow your and Jquery isn’t there. The way to fix this is to have JQuery in the header so it can ask it as soon as the slider needs it.

    Go into the minify settings and make sure that set it to manual and manually add the js/css files (you can use the help button), and make sure that JQuery is set to block and it is in the header and this should solve the problem.

    i have used but not solved any other solution?

    marketsys

    (@marketsys)

    I had similar problems, i found my issue is that i had manually added some script tags to header and inline script eg

    <script type=”text/javascript” src=”….” />

    Make sure you remove any you have added like that and use the dedicated wordpress method of wp_enqueue_script in your functions.php(and same for css use wp_enqueue_style)

    using this method there is a way to specify the load order so i just specify them to be loaded after jquery and then the minification and javascript functionality worked as intended with w3 total cache as everything was done in the right order

    eg:

    wp_enqueue_script( ‘mytheme-bootstrap-js’, $dir . ‘/js/bootstrap.js’, array( ‘jquery’ ), null, true );

    • This reply was modified 8 years ago by marketsys.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘jQuery is not defined error after 0.9.5 and 0.9.5.1’ is closed to new replies.