The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Code school – plugin implementation Reply To: Code school – plugin implementation


I think Kuzyo was asking why: this.each(function() { …part of the code worked when: var vacation = this; …didn’t.

This is just a misunderstanding about this. this is the context that the current function is executing in. In the this.each part, this is the jQuery plugin. In the iterating function, however, this is the individual DOM element that the jQuery object passes in.


Another example of why you need to learn javascript and not just jQuery. (Not accusing you of this; just a general observation.)