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? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -