Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Interactive Web Pages with JavaScript Traversing and Manipulating the DOM with JavaScript Appending and Removing Elements

Akhter Rasool
Akhter Rasool
8,597 Points

Storing in server

after i perform the tasks, and i hit refresh page, all the listitems come back as they used to(because they're written in html code), how do i store the changes in server?? So that i dont find deleted elements.

3 Answers

Matthew Brock
Matthew Brock
16,791 Points

Yes you would have to look into PHP and a database like MySQL. There are other server languages like Ruby on Rails or python but not as familiar with them like i am with PHP.

I believe if you finish the PHP track it will cover the database side of it as well. Of course you will need a server to test it with, you can get free ones like XAMPP to test with. I believe that is all discussed in the PHP track though.

You might want to read on local storage

Matthew Brock
Matthew Brock
16,791 Points

When you refresh the page it will come back to the original code. That is just the way this example code works.

To have it store changes on the server you would either have to write to a file or save in a database. With saving in a database being the preferred method. And of course you would have to read the items from the database on the load of the web page. You would have to use a server language like php.

Those topics are discussed in other treehouse courses.

Akhter Rasool
Akhter Rasool
8,597 Points

Do i need to refer php course, or database course for that ?