When working with native JS, I am familiar with using AJAX to display the output from PHP/mySql that is not Json Encoded in the element "some_id" like this:
<script>
function addItem(value) {
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("some_id").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET","some_php.php?q="+value,true);
xmlhttp.send();
}
</script>
However, when dealing with JSON encoded results from PHP/mySQL, how can I display it in "some_id" using AJAX?