running so far
This commit is contained in:
+26
-2
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user