News for hackers. Stuff that matters.
Re:Signs of a poorly written jQuery plugin by NathanKP on Thursday June 03, 2010 @10:02AM (#1401307)
This article helped me a lot. I had always thought that it had to be written as:

$(this).each(...)

Knowing that I can use:

this.each()

will allow me to simplify things a bit.

Re:Signs of a poorly written jQuery plugin by twism on Thursday June 03, 2010 @11:44AM (#1401613)
In the context of plugin code, "this" is a jQuery object. In event callbacks or operating on DOM elements, "this" is a plain old DOM object.
Re:Signs of a poorly written jQuery plugin by benmathes on Thursday June 03, 2010 @05:43PM (#1402682)
Saying $(this).somejQueryFunction() is defensive programming, it ensures that your object gets jQuery'd. If it's already a jQuery object, it's not expensive to do. This is generic advice for all the various kinds of 'this' that you'll encounter in javascript, not the specific case mentioned in the linked article.
Re:Signs of a poorly written jQuery plugin by po on Friday June 04, 2010 @08:10AM (#1404057)
It does seem a bit nit-picky. I would expect that right away in the JQuery call tests if it's already a JQuery object and short-circuits. It would save you one call and it's not exactly in a tight loop.

Maybe as a sign-post that the person doesn't really understand JQuery plugins very well…

Re:Signs of a poorly written jQuery plugin by vinhboy on Thursday June 03, 2010 @10:58AM (#1401477)
Yea great article. I also had a simliar misconception.