@TomD, you are correct in that it will still load assets unfortunately, however I suppose even that can be tricked into working and only loading the assets that are really needed to each page, although it can get messy.
Personally this is not something I have ever needed to do, in fact I personally would not do this on my own projects because they are very asset intensive, and managing a single page site would just be a nightmare, but the question was asked so I was just showing a way it could be done, if the site is not asset heavy then this could be a solution.
Even the server connect side could be made that things only happen when certain conditions are met so the page will not have hundreds of queries all running at the same time.
What always applies to me though is, just because something CAN be done, does not necessarily mean it should be done, and I figured a tutorial like this at least gives a nice introduction to using variables and conditions to those that might not use them currently.