I am trying to figure out the best way I retrieve php variables with AJAX and then make those variables into javascript variables.
Let's say I have the following within my php file:
echo $total;
echo $actual;
Edit: JSON
echo json_encode($comments);
How can I turn these php variables into javascript variables within the AJAX call success: function (data) {
or is there a better way to do this?