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
if (!a) { // is emtpy }
To ignore white space for strings:
if (!a.trim()) { // is empty or whitespace }
If you need legacy support (IE8-) for trim(), use $.trim or a polyfill.
trim()