1

私のasp.net Webサイトでは、1つのコンテンツページの戻るボタンを無効にしたいと考えています。だから、私はコンテンツページで以下のJavaスクリプトコードを使用しました

 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);

 changeHashOnLoad();

上記のコードは chrome と mozilla firefox では正しく動作しますが、Internet Explorer ではページが正しくスクロールしません。どなたか解決策をお願いします。

ありがとうございました。

4

0 に答える 0