When I'm writing jQuery code I like to use $varName to refer to vars which store a jQuery object, and plain old varName for everything else. This is a fairly common technique that I picked up from I think Paul Irish or Rebecca Murphey.
In your case of $this and this I would generally declare var self = this rather than var $this = this. Fairly often if "this" is an HTML element I'll declare var $this = $(this).
Not saying your way is wrong but I do find it helps me to keep my jQuerified and non jQuerified variables visibly separate.
5 comments
[ 6.5 ms ] story [ 34.7 ms ] threadIn your case of $this and this I would generally declare var self = this rather than var $this = this. Fairly often if "this" is an HTML element I'll declare var $this = $(this).
Not saying your way is wrong but I do find it helps me to keep my jQuerified and non jQuerified variables visibly separate.
Like you I like to avoid the use of "$" character unless dealing with jQuerified variables
https://github.com/c4urself/jQuery-Plugin-Template/blob/mast...