user3657517 user3657517 - 1 year ago 71
HTML Question

Display json feed data into html

I want to display data from below url to html page:|bqcTMDgKwdzdDyOeD8uyIKEYZlo

(to display latest post from facebook).

Here it the code so far:

<!DOCTYPE html>


<div id="id01"></div>

var xmlhttp = new XMLHttpRequest();
var url = "|bqcTMDgKwdzdDyOeD8uyIKEYZlo";"GET", url, true);

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].story +
"</td><td>" +
arr[i].story +
"</td><td>" +
arr[i].created_time +
out += "</table>";
document.getElementById("id01").innerHTML = out;


But I am not getting any results.

Can anyone please help if I am missing anything?

Thank you

Answer Source

Try this


  var out = "<table>";

    for(i = 0; i <; i++) {
        out += "<tr><td>" +[i].story +
        "</td><td>" +[i].story +
        "</td><td>" +[i].created_time +
    out += "</table>";
<script src=""></script>

<div id="divContent"></div>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download