I've been trying to create a news box for my website today and I have a problem. Let me explain what happens. I create a 2d array that contains the news (date and the news). I then loop through it to construct the news_string and then use that for the DIV's innerHTML. I have put a very simple version of it below
for (var i = 0; i < news.length; i++)
{
news_string.concat(news[i][1],"<br>");
}
document.getElementById("news-content").innerHTML = news_string;
However nothing appears. I have cut it down to the very minimal. No result. I have used alerts. Nothing appears. The news_string is blank regardless of the fact I put data into it. And even if I do gain a string nothing appears in the DIV box. What's causing this massive break?
"; alert(news_string) The string completely appears – Jeremy Beare Feb 16 '14 at 11:14
");` ? – Sergio Feb 16 '14 at 11:16
");`? and findally `res` should append as `innerHTML` – Suman Bogati Feb 16 '14 at 11:22