What is the best way to test for an empty string with jquery-out-of-the-box, i.e. without plugins? I tried this.
But it did\'t work at least out-of-the-box. It woul
The link you gave seems to be attempting something different to the test you are trying to avoid repeating.
if (a == null || a=='')
tests if the string is an empty string or null. The article you linked to tests if the string consists entirely of whitespace (or is empty).
The test you described can be replaced by:
if (!a)
Because in javascript, an empty string, and null, both evaluate to false in a boolean context.