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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

c++ - How to modify context menu of internet explorer using IDocHostUIHandler::ShowContextMenu? -

c# - Asterisk click to call -