title: jQuery generate password
body: <p>Now I'm using:</p>
  
  <pre><code>$generate = substr(md5(uniqid(mt_rand(), true)), 0, 8);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$('#generateNew').on('click', function () {
      var generated = "&lt;?=$generate;?&gt;";
      $.post('', function( data ) {
          //...on success alert(generated);
  </code></pre>
  
  <p>But I want to move this javascript to .js file, not on the same page as php <code>$generate</code>, then my question will be. How can I generate same password as in <code>$generate</code>but only in js? Thanks in advance ;)</p>