So I have some javascript class and in one method I use jQuery to bind function to click event. And within this function I need to call other methods of this class. In usual js function I did it through "this.method_name()", but here, I guess, jQuery redefines “this” pointer.
So I have some javascript class and in one method I use jQuery to
Share
jQuery doesn’t redefine the
thispointer, but that’s how JavaScript functions work in general. Store a reference to the this pointer under a different name, and use that.See this answer for more approaches.