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

How i can send to a txt.file the content that is in my ul tables

Hi. I have opened before a month a discussion about this but Now i know the basics of node so its should be more straight forward.

I have a project which i already builted. I have a 2 tables in the project. 1 table is for active tools that already got taken and the other table is for the tools that has been returned with the date. I save all the data in the localStorage.

I want to create some feature which sends the existing rows in the logs table to a txt file when i press on "delete logs", which basically clean the table and removed the data of the localstorage.

this is the current snapshot: https://w.trhou.se/oanaaidb18

I already created a basic server and a file called render.js which holds 2 functions, 1 for reading a file and another fucntion for writing to a txt file.

Both functions are working, I tried to read from the index.html the html markup and then to write it into the temps.txt file and it worked.

But i dont really know how to implement this in my project. The mainapp.js is responsible for all the frontend stuff which is adding a tool, removing a tool and save it to localStorage.

anyone have any ideas or guides to this? i will appreciate any help

Steven Parker

2 Answers

As u can see here, i write the content of the html page sucesfully: https://gyazo.com/9932121e60307912f48546400ca8be93