I found the problem will display the results jSon to a web page at run time data is empty or blank web page, if anyone could help me ?
This my variable declare
var xmlhttp = new XMLHttpRequest();
var url = "http://adisapu10022.besaba.com/smsVerify/json.php";
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
myFunction(xmlhttp.responseText);
}
}
xmlhttp.open("GET", url, true);
xmlhttp.send();
This my function
function myFunction(response) {
var arr = JSON.parse(response);
var i;
var out = "<table>";
for(i = 0; i < arr.length; i++) {
out += "<tr><td>" +
arr[i].Foto +
"</td><td>" +
arr[i].Komoditas +
"</td><td>" +
arr[i].Harga +
"</td><td>" +
arr[i].Pengunggah +
"</td><td>" +
arr[i].Telp +
"</td><td>" +
arr[i].Unggah +
"</td></tr>";
}
out += "</table>";
document.getElementById("id01").innerHTML = out;
}
</div>