As per title.
I have a piece of jQuery that looks like the following
$("<div class='creditCardDetails' id='usercurrentccbox'>
<div class='creditCard'>
<div class='cardChoice'>
<span>Choose Card Type</span>
<input name='cctype' type='radio' value='V' class='lft-field' id='visa' />
<label for='visa'></label>
<input name='cctype' type='radio' value='M' class='lft-field' id='mastercard' />
<label for='mastercard'></label><input name='cctype' type='radio' value='A' class='lft-field' id='amex' />
<label for='amex'></label>
</div>
<!--cardChoice-->
<div class='cardNumber'>
<input name='ccn' id='ccn' type='text' class='long-field' value='<?php echo MaskCreditCard($loggedInfo[ccn]);?>' maxlength='19' readonly />
</div>
<div class='cardCVV'>
<input name='cvv' id='cvv' type='text' maxlength='5' class='small-field' />
</div>
<div class='creditCardName'>
<input name='ccname' id='ccname' type='text' class='long-field' value='<?php echo $loggedInfo[ccname];?>' readonly/>
</div
<div class='cardDate'>
<input name='exp1' id='exp1' type='text' maxlength='2' class='small-field' value='<?php echo $loggedInfo[ccm];?>' readonly /><input name='exp2' id='exp2' type='text' maxlength='4' class='small-field' value='<?php echo $loggedInfo[ccy];?>' readonly />
</div>
</div><!--creditCard-->").insertAfter("#paymentCardChoice");
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.
The variables I am trying to call are defined already in a config.php file.
Would I need to use something like this? if so I'm stuck with how I would call the variables in the code above.
$.post('phpfile.php', qString, function (data) {
}, "json");