It's very simple to do. In order to retrieve the page anchor (i.e. get
test from http://chris-miller.org/88#test:
var anchor = self.document.location.hash.substring( 1 );
Setting the anchor to update, for example to http://chris-miller.org/88#newAnchor it can be achived using:
self.document.location.hash = "newAnchor";
Very useful for creating permalinks to AJAX loaded content or JS popups.