In jQuery, when I call:
$("selector").a_function(function(){
this.toggleClass("a-class");
}
I am told that this
is of a certain type, and does not have the jQuery function available to it. The problem is that I am not getting jQuery objects returned to me. The way I am getting around this is to do:
jquery_object = jQuery(this);
every time. I thought that $()
is equivalent to calling jQuery
and that I am supposed to receive a jQuery object.
Is this normal? What am I doing wrong here?