Wordpress uses jQuery in noConflict mode by default. You need to reference it using jQuery
as the variable name, not $
, e.g. use
jQuery(document);
instead of
$(document);
You can easily wrap this up in a self executing function so that $
refers to jQuery again (and avoids polluting the global namespace as well), e.g.
(function ($) {
$(document);
}(jQuery));
Use jQuery's noConflict
. It did wonders for me
var example=jQuery.noConflict();
example(function(){
example('div#rift_connect').click(function(){
example('span#resultado').text("Hello, dude!");
});
});
That is, assuming you included jQuery on your HTML
<script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
Use this:
var $ =jQuery.noConflict();
Try this snippet:
jQuery(function($) {
// Your code.
})
It worked for me, maybe it will help you too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With