placing PHP Variables inside javascript file
<p>As per title.</p>

<p>I have a piece of jQuery that looks like the following</p>

<pre><code>$("&lt;div class='creditCardDetails' id='usercurrentccbox'&gt;
    &lt;div class='creditCard'&gt;
    &lt;div class='cardChoice'&gt;
    &lt;span&gt;Choose Card Type&lt;/span&gt;
    &lt;input name='cctype' type='radio' value='V' class='lft-field' id='visa' /&gt;
    &lt;label for='visa'&gt;&lt;/label&gt;
    &lt;input name='cctype' type='radio' value='M' class='lft-field' id='mastercard' /&gt;
    &lt;label for='mastercard'&gt;&lt;/label&gt;&lt;input name='cctype' type='radio' value='A' class='lft-field' id='amex' /&gt;
    &lt;label for='amex'&gt;&lt;/label&gt;
    &lt;/div&gt;
    &lt;!--cardChoice--&gt;
    &lt;div class='cardNumber'&gt;
    &lt;input name='ccn' id='ccn' type='text' class='long-field' value='&lt;?php echo MaskCreditCard($loggedInfo[ccn]);?&gt;' maxlength='19' readonly /&gt;
    &lt;/div&gt;
    &lt;div class='cardCVV'&gt;
    &lt;input name='cvv' id='cvv' type='text' maxlength='5' class='small-field' /&gt;
    &lt;/div&gt;
    &lt;div class='creditCardName'&gt;
    &lt;input name='ccname' id='ccname' type='text' class='long-field' value='&lt;?php echo $loggedInfo[ccname];?&gt;' readonly/&gt;
    &lt;/div
    &lt;div class='cardDate'&gt;
    &lt;input name='exp1' id='exp1' type='text' maxlength='2' class='small-field' value='&lt;?php echo $loggedInfo[ccm];?&gt;' readonly /&gt;&lt;input name='exp2' id='exp2' type='text' maxlength='4' class='small-field' value='&lt;?php echo $loggedInfo[ccy];?&gt;' readonly /&gt;
    &lt;/div&gt;
    &lt;/div&gt;&lt;!--creditCard--&gt;").insertAfter("#paymentCardChoice");
</code></pre>

<p>But as you'll see it has PHP Variables, if I have this embedded into my PHP file this works but I want to keep the PHP file as short as possible and placed this code inside a .js file and of course my variables only display the text of the PHP not the variable its self.</p>

<p>The variables I am trying to call are defined already in a config.php file. </p>

<p>Would I need to use something like this? if so I'm stuck with how I would call the variables in the code above.</p>

<pre><code>$.post('phpfile.php', qString, function (data) {

}, "json"); 
</code></pre>
