I’m afraid that this is possibly impossible , but is there a way to change the hash value of the URL without leaving entries in the browser history and without rebooting ? Or the equivalent?
As for the features, I was developing a basic hash of string navigation:
//hash nav -- works with js-tabs var getHash = window.location.hash; var hashPref = "tab-"; function useHash(newHash) { //set js-tab according to hash newHash = newHash.replace('#'+hashPref, ''); $("#tabs li a[href='"+ newHash +"']").click(); } function setHash(newHash) { //set hash according to js-tab window.location.hash = hashPref + newHash; //THIS IS WHERE I would like to REPLACE the location.hash //without a history entry } // ... a lot of irrelavent tabs js and then.... //make tabs work $("#tabs.js-tabs a").live("click", function() { var showMe = $(this).attr("href"); $(showMe).show(); setHash(showMe); return false; }); //hash nav on ready .. if hash exists, execute if ( getHash ){ useHash(getHash); }
Using jQuery is obvious. The idea is that in this particular case: 1) force the user to return to each permutation of the tabs, can effectively “break the back button”, piling up unnecessary links and 2) not preserving the tab in which they are now if they fall into update annoyance.
javascript jquery browser-history fragment-identifier browser-state
D_N Feb 21 '10 at 6:29 2010-02-21 06:29
source share