Hacker News new | ask | show | jobs
by odiroot 5470 days ago
Or you could use progressive JavaScript, AFAIK. Make your every link a first class citizen (with it's own view) and for supported browsers replace links' default action with content switching (without reloading) using JS requests.

Of course that's a bit harder since your views need to respond in a different manner to casual GETs and AJAX requests.

1 comments

Which really should be trivial using most modern 3-Tier frameworks. They universally have a concept of "layout" vs "template" so in a pseudocode logic, all you need to do is tap into the render method and swap out an empty layout when responding to an XHR request.
Exactly, however one can argue the number of your test cases (and cache entries) doubles. Still I think it's an elegant solution.