title: Set Javascript Variable From PHP Get Variable
body: <p>I have a page which I have collected two variables, I want to pass these variables to my document ready function. but for some reason.. My alerts for testing are just outputting the line code rather than the result.</p>
  
  <p>just to note the JS script is in another file which is linked to the page.</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php 
  
  $cardid = test;
  $custid = test;
  
  ?&gt;
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>$(document).ready(function(){
  
     var custid = '&lt;?php echo($custid); ?&gt;';
     var cardid = '&lt;?php echo($cardid); ?&gt;';
  
     alert(custid);
     alert(cardid);
  });
  </code></pre>