2016-09-20 34 views
-3
 function theLast(){ 

      if (document.getElementById('dont').checked) { 
      document.getElementById('dont').checked=false;} 
      else if(document.getElementById('know').checked){ 
       document.getElementById('know').checked=false;} 
      else if(document.getElementById('master').checked){ 

       document.getElementById('master').checked=false;} 
       else { 
       document.getElementById('ans').reset();} 
     document.getElementById("pop2").style.display = 'none'; 
     document.getElementById("myPopup").style.display = 'none'; 
     document.getElementById("pop3").style.display = 'none'; 


     document.getElementById("pop4").style.display = 'block'; 
     document.getElementById('pop4').style.position = "absolute"; 
     document.getElementById('pop4').style.top = '250px'; 
     document.getElementById('pop4').style.left = '250px'; 
     setTimeout(function(){ 
     document.getElementById('pop4').className = 'waa'; 

    }, 2500); 



window.location.reload(); 


} 

我想在這個函數 年底重裝我的網頁試圖window.location.reload() location.reload(真)window.reload()不刷新我的網頁

是有任何其他方式我可以重新加載我的網頁?

+0

的可能的複製[如何使用Javascript重新加載頁面?](http://stackoverflow.com/questions/3715047/how-to-reload-a-page-using-javascript) – showdev

+3

1.清理你的代碼。 2.我無法在代碼中的任何位置找到'window.reload'或'window.location.reload'(這是正確的)。 – idmean

+0

我沒有看到你調用'window.location.reload'的代碼中的任何地方。這可能是它不工作的原因。 「 – Amy

回答

0
$('#something').click(function() { 
location.reload(); 
}); 

添加這個腳本中的

+0

爲什麼我需要包裝在'setTimeout'? – 2016-09-20 17:06:30

1

我不知道有關location.reload的支持,但你爲什麼不試試這個:

window.location.href = window.location.href;

+0

你確定嗎? – 2016-09-20 17:39:17

+0

你是什麼意思? – Marco

+0

對不起,我的意思是「你不知道什麼?」。 – 2016-09-20 17:48:42