Unobtrusive Permalinks
Automated disclaimer: This post was written more than 15 years ago and I may not have looked at it since.
Older posts may not align with who I am today and how I would think or write, and may have been written in reaction to a cultural context that no longer applies. Some of my high school or college posts are just embarrassing. However, I have left them public because I believe in keeping old web pages aliveāand it's interesting to see how I've changed.
One of the problems with AJAX-style hash-based permalinks (as in use at WikiMapia) is that the browser's history becomes cluttered, and the user has to hit Back a large number of times to escape the page. By using location.replace, I've devised a way to keep the history pristine yet allow DOM-state permalinks.
Check out the demo. (Should be working now, thanks wioota.)
wioota says:
The demo is coming up a 404, currently. I am very interested to see it.
Tim McCormack says:
Ack! Sorry about that. I'll get it working tomorrow. I accidentally overwrote it with a demo of a more advanced version, which allows access to the hash as if it were a querystring.
Tim McCormack says:
Okay, original demo is back up, but you may want to play with the more advanced demo. In your FireBug console, try executing things like PermaHash.set('foo', 'bar'), PermaHash.unset('focus'), and PermaHash.objectFromHash(). It's still in development, but it's gonna be rockin' cool when it's done.