+ 1
Is it possible to show in a blog-like webpage the last three posts only with JavaScript?
In order to train myself and improve my knowledge about JavaScript, I am planning to code a function that is able to show inside a simple blog-like HTML webpage the last three posts. These latter should be stored as simple text files with little HTML formatting tags inside a folder and their name should be the date on which the post has been published. Is it possible to do this with JavaScript? In particular, is it possible to scan a website folder and create an array of file names? Furthermore, is it possible to read a text file and then print it inside the main HTML webpage? Thanks in advance for your help.
3 Réponses
+ 2
just use the create objects of DOM in JavaScript
+ 1
@Ian
The code included in your answer is not properly clear. Can you please explain it a bit more?
0
yes you can use DOM and
function x {
document.getElementById("some id")
prompt("something")
var a = input;
document.createElement("p")
p.append(a);
x();
}
this is an example but that is bacically how you would do it