In native JS, I only know how to use AJAX to output result from PHP/mySql which is not Json Encode to 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>
But if the result of PHP/mySQL is Json Encoded, how do I output it to "some_id" in AJAX?
JSON.parsefor it