Routing techniques are needed used in server-side web development. In JavaScript apps is often the #hash in the URL used. The History API can be used to change the browser URL without page re-load if needed.
Here is an example (make sure to show the developer console).
One more example with navigation between screens.