Remove spaces in a javascirpt variable
<p>I'm using AJAX to retrieve data from MYSQL database through PHP.... </p>

<p>but if there is no result found, still variable has two spaces.. I found it using <code>alert(data.length);</code> - result is <strong>2</strong> which means there is two spaces..</p>

<p>How to remove these spaces? so if there is no result I could display a message using <code>if(data == ''){}</code></p>

<p>Thank you!</p>
