Inheriting a codebase isn’t fun. Even less fun if the code is filled with so many memory leaks that the only solution is to force a full page load on every route change. Below is a solution that works well in modern browsers, and IE9.
Note the check for
changedTo. Without these, an infinite loop will occur.