简体   繁体   中英

Dynamically Created html elements saved to database?

I have been teaching myself javascript and now wish to take my program live so I can develop further to learn more and more.

What I am looking to do is store all the rows/cells that are created by the user into a database. So that when they reload the page or someone else loads the page. They can see all the information that other people have added.

Now I feel the best way to do this was to have it sent to the database upon the user clicking a 'save to database' button.

What is the best way to do this, and how would I go about it?

Here is my code:

https://github.com/harryth3hopp3r/JobList

Any help would be appreciated!

If you want to share data between users you should build a backend for it. Then you can send the data to the backend with an AJAX call, for example.

If you are to build a backend you would need a web server to make it available to your users.

If you want to stick with Javascript you could use NodeJS in your server infrastructure, and then you can connect it to a mongoDB database, which is quite simple to use. I could explain the whole process but I think it's better that you go through the specific tutorials and make more specific questions when they come.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM