Hacker News new | ask | show | jobs
by Hipchan 5468 days ago
http://stackoverflow.com/questions/6193858/pushstate-and-seo

pushState's SEO issues.

2 comments

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.

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.
How can there be SEO issues? I thought the whole point of pushState was to allow AJAX loading of content (without refresh) but not break URLS with #!.
There aren't if used correctly. The SO questioner has a misunderstanding of how the history API and the hashbang scheme are supposed to work.