Cant update status dynamically.
I was able to complete this task but the thing is when I go back to "employees.js" file and change the 'inoffice' status I was not able to notice the changes in the HTML page dynamically until I refresh it. So what should I do to see the results dynamically??
Mikis Woodwinter44,916 Points
So, you wouldn't ever want to manually change stuff in a JSON file and save it like that; you can imagine that that would get tedious fast as the number of Employees increase. Usually, you would have some sort of API (Application Programming Interface) set up on the server side that handles tasks like creating an Employee, retrieving an Employee, updating an Employee or deleting an Employee.
This course isn't really meant to discuss how API's work; it's main intent is to describe how AJAX works. In real-world apps, though, it'd be rare to have a use-case that required you to request a single, JSON file via AJAX — like we're doing here. Usually, your data will be kept in a database and your API would be responsible for getting stuff out of the database, — perhaps parsing that data into JSON, if you wanted — and subsequently sending that data back to your Client as a response. Likewise, your Client would be able to use that same API to update a specific Employee's details, delete an Employee and so on.
Let me know if that helps :)