design patterns - jQuery hasclass structure -
see link: http://james.padolsey.com/jquery/#v=1.4&fn=jquery.fn.hasclass
var classname = " " + selector + " "; .... (" " + this[i].classname + " ") many times in career i've had uses functions trim whitespace, have never seen reason add whitespace. purpose of empty strings being prepended , appended these variables.
say have element classes foo , foobar, adding spaces @ start , end, ensures have spaces sourrding name of each class. allows search " foo " , avoid matching foobar.
off: moved answer question marked answered.
Comments
Post a Comment