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

javascript persistence for multiple clients

Hey guys I was wondering if I can get some guidance I have a javascript app that works great except when the user closes the browser, all the data gets refreshed so I wanted to see If I can get some insight on keeping the data persistent that way if another person goes to the url they will also see the same data.

here is the link to the app http://tefnick.com/repairsched.html

2 Answers

Steven Parker
Steven Parker
230,230 Points

This looks familiar, I think I answered a question about this form before. :wink:

But the JavaScript code is running in the browser itself. To make the data entered show up for another user, or even for the same user in a new browser window, you will need to submit the changes back to the server, and there will have to be server code to store it and then use it to construct the page when it is requested again.

So to do what you want, you will need to develop a "web app" that runs in the server.

So I been researching Node.js and express would you say these would be good candidates for what I'm trying to do? I'm completely new to backend technologies and looking forward to getting into that but not sure what would suit best for this particular project. But thanks for your comments thus far!

Steven Parker
Steven Parker
230,230 Points

Node would allow you to write your web app in JavaScript and run it on the server. There's a course called Build a Simple Dynamic Site with Node.js that might help. There are also plenty courses available for popular server-side languages like PHP and Ruby.

Thanks man! I'll check those out!