• Resolved smhmic

    (@smhmic)


    I encountered a Javascript issue with your plugin that I think is easily fixable.

    As you know, WordPress loads jQuery in noConflict mode by default. Some websites undo this by placing the following in the <head>:
    <script>var $ = jQuery.noConflict();</script>
    They may do it because they are not coding according to best practices, or they may need to cater to some third-party code.

    This plugin re-activates noConflict mode.

    I was able to workaround this issue for my client, but it seems like a unfriendly practice for your plugin to activate noConflict mode. I noticed different situations in the forums that were not compatible with this same issue in your plugin.

    Fortunately, it seems like your plugin doesn’t need noConflict mode at all.

    You could simply …
    var $RMjQuery = jQuery
    … or even better, just use jQuery instead of the $RMjQuery alias.

    Hopefully this is helpful!

    https://www.ads-software.com/plugins/responsive-menu/

Viewing 1 replies (of 1 total)
  • Hi smhmic,

    Thanks for the suggestions!

    I will admit I am more of a PHP developer than jQuery and as such obviously don’t have as much knowledge of you in this area.

    I initially started out in my first version using var $RMjQuery = jQuery, however this was causing issues on many peoples sites.

    It wasn’t until I change it to how it is now that all of peoples issues dissappeared.

    I will have to do some more research myself into this before changing it, but thanks for the advice!

    Many thanks

    Peter

Viewing 1 replies (of 1 total)
  • The topic ‘Suggested code change – ditch jQuery.noConflict()’ is closed to new replies.