var _hash = {
param: {},
current: '',
set: function(data)
{
if(_hash.current == data)
{
log('lock change hash');
return;
}
window.location.href = '#' + data;
},
get: function()
{
var _href = window.location.href.split('#'); _hash.param = {};
if(_href[1])
{
var _tmp = _href[1].split('&');
for(i in _tmp)
{
_hash.param[_tmp[i].split('=')[0]] = _tmp[i].split('=')[1];
}
}
_hash.current = _href[1];
log('param changed: ', _hash.param);
}
};
$(document).rady(function(){
$('a:not(.nolink)').on('click', function (event)
{
event.preventDefault();
_hash.set(this.href.replace(/^.*#/, ''));
});
$(window).bind('hashchange', function()
{
_hash.get();
});
_hash.get();
});
В _hash.get разбираешь строку как душе угодно.