
Breaking the Web with hash-bangs - tswicegood
http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs
======
joeyh
We've had hashbangs in Unix for 30 years, and while they were not entirely
perfect (bit of a violation of the kernel/userspace boundry going on; issues
with suid), they've been good to us.

It's really highly annoying that this good old thing is now associated with
flaming javascript evil.

------
andrewcooke
Maybe I'm explaining the obvious here, but there is a reason people do this.
If you have built your site so that the content is generated by Javascript
running on the client then you need some way of making the page's current
state visible so that it can be bookmarked. Without full adoption of HTML 5
that means you need to modify the URL. And the only part of the URL you can
change without forcing a pageload is the part after the #.

So you _need_ to do this if you want the user to be able to bookmark pages
whose appearance depends on Javascript running. Think of it as the equivalent
of "GET", but on the client - when the page loads, the Javascript reads what
is after the # and re-generates the content.

Of course, that then breaks search and so you need #! which is a convention
that allows server side code to give search engines the same thing that you
are showing your user. But that doesn't mean that every use of storing client
side state using # is automatically crazy or stupid or trivial to avoid.

Having said that, making a system that displays a blank page when Javascript
fails _is_ pretty dumb.

------
waqf
I could not figure out what this article was trying to say. Either I'm tireder
than I think I am or it's _really_ badly written.

~~~
daxelrod
The problem is that the meaningful part of the URL is only sent to the server
via JavaScript. Your browser doesn't normally send the fragment (the part
after the #) when you access a page.

That means there's no fallback for when the JavaScript breaks (which just
happened) or for crawlers (except Google), browsers without JavaScript, etc.
The site has absolutely no content without working JavaScript.

The author asserts that this also breaks caching. (AFAICT, more analysis would
be needed to support this, because the extra request the JavaScript makes may
very well be correctly cacheable.)

~~~
waqf
Thanks. What got me was that for some reason I couldn't figure out whether I
was being told why the author thought #! was a bad idea, or why Lifehacker had
thought it was a good idea.

------
joelangeway
The purpose and meaning of the hash-bang convention is that there is a "real"
url that corresponds to this "javascript" url. That has a lot of advantages
that the post does not mention.

~~~
dazmax
Yeah, but the post is questioning the point of changing every page to an ajax
call.

