News for hackers. Stuff that matters.
Re:Breaking the web with hash-bangs by sjs382 on Wednesday February 09, 2011 @10:09AM (#2197609)
He suggests using real URLs - instead of "/#!5753509/hello-world-this-is-the-new-lifehacker" we would have "/5753509/hello-world-this-is-the-new-lifehacker". Sounds great, but what happens when you click to a new article, which is loaded with AJAX?

Well you've already confirmed that the client is running Javascript so:

1. Use JavaScript to rewrite the existing clean URLs into JS function calls (or however you want to handle that)

2. Use window.history.pushState to push the clean (canonical) URL for the page you're viewing to the browser.

I'm not sure why this isn't obvious...

Re:Breaking the web with hash-bangs by gnubardt on Wednesday February 09, 2011 @10:18AM (#2197643)
history.pushState() and history.replaceState() are introduced in the html 5 spec, so not all browsers support it yet.
Re:Breaking the web with hash-bangs by sjs382 on Wednesday February 09, 2011 @10:33AM (#2197699)
Test for the API and fall back to the hashbangs if it isn't available. Check out this example in an old browser and a modern one:

http://www.asual.com/jquery/address/samples/express/portfoli...

Re:Breaking the web with hash-bangs by ZoFreX on Wednesday February 09, 2011 @11:15AM (#2197926)
My point was the degradation to hashbang (which is what most users are going to see) is absolutely horrid, to the point that I would actively avoid it.
Re:Breaking the web with hash-bangs by sjs382 on Wednesday February 09, 2011 @12:25PM (#2198284)
You're concerned about /content/123/#!/content/456/, right?

Well, if the client isn't modern, 301 them to #!/content/456/ and proceed as you would.

Either way though, all this is terrible for a blog, or even Twitter.