how to check if var is not empty with javascript?
<p>Not having much luck with this.  I'm trying to determine if a var is not empty.  </p>

<pre><code>$('#content').mouseup(function() {

    var selection = getSelected();

    if (typeof(selection) !=='undefined') {
        alert(selection);
    }
});
</code></pre>

<p>What this is doing is grabbing any text the user has selected -- but it shows an empty alert even if the user just mouseup's on the div.  </p>
