I'm using ajax in my website and there is an ajax function that controls all links.
something like this:
function sendGet(url,dataform){
$.post(url,{_ajax:1},function(data){
$(dataform).html(data);
window.location.hash = url;
});
return false;
}
and set hash with url.
alse I have this code in document load:
var load_hash = window.setInterval(function(){
if(window.location.hash) sendGet(window.location.hash.substr(1),"#include_content");
clearInterval(load_hash);
},1);
when back button is pressing I want to load the url in hash.
BUT most of the time it is not working. it works sometimes when I refresh the page.
am I doing it right?
if not, is there any other way to do this?