Suggested code change – ditch jQuery.noConflict()
-
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 usejQuery
instead of the$RMjQuery
alias.Hopefully this is helpful!
- The topic ‘Suggested code change – ditch jQuery.noConflict()’ is closed to new replies.