I'm trying to learn how to create a blog and have stumbled upon the problem of being able to add new content to an existing web page.
The idea is to create two web pages.
Page one; Home page (empty)
Page two; Web form that when submitting, will dynamically add the content of the filled out form onto page one (home page).
So far, with JavaScript i've learned how to create a new element on the click of a button which will add a div onto the current page but I want to find a way to add content to another page (somehow).
Code used to add element on button click
var number = 1;
document.getElementById("add_more").addEventListener("click", function() {
var newDiv = document.createElement('div');
newDiv.id = 'ep_holder';
newDiv.innerHTML = 'hello world';
document.getElementById('contain_form_upload').appendChild(newDiv);
});
I've tried numerous times to search for content on the web to help me but everything i stumble across seams to be Wordpress related which has left me no option but to ask the question on here!
I would appreciate if somebody could take the time to help me!
Thanks in advance, Sam.
HTMLelements then inject the data in to said elements using AJAX requests, it'd be much easier to maintain in the future. Think about making elements for every time you want dynamic content e.g. making tables usingJavaScript. :Opage 2the entered values will then appear onpage 1or do you mean that the user goes topage 2, submits the form and then when they return topage 1the entered values are then visible?