javascript check if null or white space or no space
<p>I need to check to see if a var is null or has any empty spaces or for that matter just blank ("")</p>

<p>I have the following but not working:</p>

<pre><code>var addr;
addr = "  ";

if (!addr) {
    // pull error 
}
</code></pre>

<p>if I do following it works</p>

<pre><code>if (addr) {

}​
</code></pre>

<p>What I need is something like this C# method:</p>

<pre><code>String.IsNullOrWhiteSpace(value)
</code></pre>

<p>so that if it is null or has any spaces or no space, I can trap it </p>
