So far, I have got the following:
$.getJSON('getinfo.php', { id:id }, parseInfo);
function parseInfo(data) {
$('div#info').fadeOut("fast", function() {
$('div#info').html(data.desc);
}
}
I am able to print the results (data.desc) inside the div#info html tag, but before I do so, I want to format data.desc with my php function. So, basically I want to do something like this,
function parseInfo(data) {
$('div#info').fadeOut("fast", function() {
<?php
$formated = some_php_function(data.desc);
?>
$('div#info').html(<?php echo $formated ?>);
}
}
Is this possible? Can anybody out there please help me. I can't seem to get around this.
Many thanks in advance.