1

I am using this client side code to disable browser back button. The function "changeHasgOnLoad" is called in body tag's onload

    function changeHashOnLoad() {
    window.location.href += "#";
    setTimeout("changeHashAgain()", "50");
}

function changeHashAgain() {
    window.location.href += "1";
}

var storedHash = window.location.hash;
window.setInterval(function () {
    if (window.location.hash != storedHash) {
        window.location.hash = storedHash;
    }
}, 50);

Its working fine but when i open it in IE its preventing page from scrolling. but when i refresh the page then it works well. Please help me if anyone can know its reason.

Moin
  • 11
  • 5
  • Since SO users should not judge the content of questions with obviously malicious intent (http://meta.stackoverflow.com/questions/276845/how-to-handle-questions-with-seemingly-malicious-albeit-legal-intent) i just decided to not answer this quesion and i hope that others won't as well. – Chris Apr 20 '15 at 07:36
  • i didn't understand your point. – Moin Apr 20 '15 at 07:44
  • Why do you want to do this strange thing? – Michael Geary Apr 20 '15 at 07:58
  • Its also strange for me my boss want me to do that, so what i can do – Moin Apr 21 '15 at 07:04

0 Answers0