running so far

This commit is contained in:
2022-12-27 18:17:24 +01:00
parent 31b47e892d
commit 8b121c9e6e
16 changed files with 134 additions and 18 deletions
+26 -2
View File
@@ -25,8 +25,32 @@ function apiCall(url, method) {
return xhr;
}
function runRenderProcess(params) {
document.getElementById("mainContainer").innerHtml = params;
function runRenderProcess(data) {
params = renderArticle(data["feeds"]);
// document.getElementById("mainContainer").innerHtml = params;
}
function renderArticle(feeds) {
let placeholder = "<div>";
for (i = 0; i < feeds.length; i++) {
let title = feeds[i]["title"];
placeholder += '<div class="itemContainer">' + "<p>" + title + "</p>";
let items = feeds[i]["items"];
for (t = 0; t < items.length; t++) {
placeholder +=
'<div class="article">' +
"<p>" +
items[t].title +
"</p>" +
"<p>" +
items[t].content +
"</p>";
}
placeholder += "</div>" + "</div>";
}
placeholder += "</div>";
document.getElementById("mainContainer").innerHTML = placeholder;
}
function getArticles() {