We really only need this right now for the rent confirmation but later in the project we need this system anyways because it makes the usability better when you can share a link to the thing your actually doing not just the homepage so its smart to implement basic features already.
Write a class that allows you to interact with the url and that checks the url on page load and updates the webpage.
[x] we need to be able to go through the url step by step and execute actions without having a nightmare of nested ifs so it would probably be best to represent the url in a json structure roughly like this. (note that the openDetailView function does not exist, its just an example)
[x] the class should provide a function like parseCurrentURL that takes the current url, parses it and then references it to the tree, executing the right handler function as it goes along
[x] we also need a function like getParam which returns the value of any ? param in the url
[x] to interact with the url we need a function that sets the url params (leaves the rest of the url untouched)
[x] we also need a function to set/the/path in the url.. i think its fine if this just takes a the whole string and then writes it to the url, without changing the params of course
[x] the most important thing here is that none of this causes a page reload: this is possible i have experimented with it you just need to find it
We really only need this right now for the rent confirmation but later in the project we need this system anyways because it makes the usability better when you can share a link to the thing your actually doing not just the homepage so its smart to implement basic features already.
Write a class that allows you to interact with the url and that checks the url on page load and updates the webpage.
openDetailView
function does not exist, its just an example)parseCurrentURL
that takes the current url, parses it and then references it to the tree, executing the right handler function as it goes alonggetParam
which returns the value of any ? param in the url