JavaScript: Check if a string has white space
<p>I am trying to check if a string has white space. I found this function but it doesn't seemt o be working:</p>

<pre><code> function hasWhiteSpace(s) {

  reWhiteSpace = new RegExp("/^\s+$/");
  // Check for white space
  if (reWhiteSpace.test(s)) {
  //alert("Please Check Your Fields For Spaces");
  return false;
  }
  return true;
 }
</code></pre>

<p>Btw, I added quotes to RegExp. </p>

<p>Is there something wrong? Is there anything better that I can use? Hopefully JQuery.</p>

<p>Thanks for any help.</p>
