My website is available at http://visualise.ca/ and when you load a post by clicking a thumbnail it will loads the post within the page using ajax. When you close the post it uses this code in order to change the url back to http://visualise.ca/ without reloading the page:
$("#close").live("click", function(event) {
$("#board").fadeOut("slow");
$("#board-wrapper").slideUp("slow");
$("html,body").delay(1000).animate({scrollTop: 0}, 300);
window.location.hash = "";
window.history.pushState(null,null,site_url+"/");
return false;
});
but in IE8 it changes it back to http://visualise.ca/# instead of http://visualise.ca/. Is there a way to correct this and make sure it is changed to http://visualise.ca/ ?
I happen to be doing a lot of ajax history lately. I am trying my own implementation where I navigate through pages and modals and back and fourth. Making very good progress.
Since the beginning of the tests I have noticed that the root hash; ONCE CHANGED back to the initial page (where it all started) it, only loses the hash (#) if it was a BROWSER BACK button click. If I change the hash back to ”, it will ALWAYS show the /# at the end.
As far as IE8 is concerned, I don’t believe there is any solution but using the iFrame hack and, since I have not got around to test IE8/iframe hack yet, I cannot comment on it.
For my solution I am using a mix of hash and pure command control. I should have the final version fully tested within a couple of weeks (wishful thinking).
Besides, who cares if a hash/sharp is left at the end of the url. I NEVER LOOK AT THE URL once I hit a web site; I just look at the contents of the page. REALLY: it just hit me that the url is only important when I want to copy and paste it. Other than that, I NEVER look at it.