What might cause Firefox to tell me $ is not defined, but using 'jQuery' works as expected.
I'm on Wordpress 3.4 and Wordpress comes packaged with jQuery. Is it something specific to Wordpress?
What might cause Firefox to tell me $ is not defined, but using 'jQuery' works as expected.
I'm on Wordpress 3.4 and Wordpress comes packaged with jQuery. Is it something specific to Wordpress?
jQuery.noConflict()
has been called. To resolve this with a minimum amount of code change do this.
Before:
$("your").code(function () {
$("that").uses($.all("over").the("place"));
});
After:
(function ($) {
$("your").code(function () {
$("that").uses($.all("over").the("place"));
});
})(jQuery);
$
not being jQuery
(otherwise there'd be no reason to use noConflict()
in the first place). Your suggestion would fix one bit of code and break the other.
jQuery works in noConflict mode inside wordpress as the docs state: http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers