Support » Plugins » jQuery Collisions – Prevent in WordPress?

  • I have a WordPress plugin that is encountering collisions with other versions of jQuery that other themes and plugins are loading.

    Unfortunately, these other themes/plugins are not loading jQuery via the preferred method – wp_enqueue_script, which would prevent duplicate loading of jQuery, so it gets loaded within the theme for their use via echo ‘…..’ and then I load it again via wp_enqueue_script.

    When I comment out the theme’s loading of jQuery, everything works since we both require the same version.

    I cannot predict what themes and plugins that my plugin will need to coexist with and whether they load jQuery properly. I cannot users of my plugin to comment out bad code in other themes and plugins.

    These themes are sold commercially, and are therefore “premium” themes, but the jQuery loading must have been put in the code prior to WP 2.1 when wp_enqueue_script was made available.

    I need a strategy to isolate me from jQuery collisions – to rectify this specific error, and others that are yet unknown but will surely happen.

    Anyone have any suggestions? Thanks.

  • The topic ‘jQuery Collisions – Prevent in WordPress?’ is closed to new replies.