I have a url like
var hash = window.location.hash;
More info here: https://developer.mozilla.org/en/DOM/window.location
Update: This will grab all characters after the hashtag, including any query strings. From the MOZ manual:
window.location.hash === the part of the URL that follows the # symbol, including the # symbol. You can listen for the hashchange event to get notified of changes to the hash in supporting browsers.