function changeHash(id) { try { history.replaceState(null,null,'?id='+ id); } catch(e) { location.hash = '#id_'+id; } }