Closed iamcal closed 8 years ago
Suppose your code looks like this:
$('select.user-picker').chosen({});
If the selector matches no elements, then the chosen() function still gets run. The value for $this (not $(this)) never gets set, but then is used.
chosen()
$this
$(this)
Suppose your code looks like this:
If the selector matches no elements, then the
chosen()
function still gets run. The value for$this
(not$(this)
) never gets set, but then is used.