Here is a JSFiddle for ease: http://jsfiddle.net/u5XmR/
I have a lot going on, but my main concern is why the $(“#content”).append(); is not changing anything on my page.
Specifically this function should adjust and change the content dynamically:
function findpost(timestamp, blog){
//console.log(blog);
var length = blog.length;
for(var e=0; e<length; e++){
var type = blog[e+1];
if(timestamp === blog[e]){
if(type === 0){
$("#content").append("\
<div id='post' class='photo'>\
<img src='"+blog[e+2]+"' width='400px'/>\
</div>\
");
console.log("Photo");
} else if(type === 1){
console.log("Video");
} else if(type === 2){
$("#content").append("\
<div id='post' class='link' />\
"+blog[e+2]+" "+blog[e+3]+"\
</div>\
");
console.log("Link!");
} else if(type === 3){
console.log("Text!");
} else if(type === 4){
console.log("Tweet!");
} else {
console.warn("ERROR!");
}
}
}
}
You are clearing the
$('#content')everytime in the for loopCheck out this updated fiddle
http://jsfiddle.net/u5XmR/6/
In the
.done()This is what you need to change: