loadImg.js 661 B

123456789101112131415161718192021222324252627
  1. window.onload = function () {
  2. console.log("End expe " + END_EXPE)
  3. // only if not end of expe
  4. if (END_EXPE == "False"){
  5. setTimeout(function(){
  6. document.getElementById("expeImg").style.display = "inline";
  7. }, 500);
  8. }
  9. // redirect if end of expe after 5 sec
  10. if (END_EXPE == "True"){
  11. for(var i=0; i<6; i++){
  12. ((x)=>{
  13. setTimeout(()=>
  14. document.getElementById("refreshTime").textContent = 5 - x
  15. ,1000 * i)
  16. })(i);
  17. }
  18. setTimeout(function(){
  19. window.location = baseUrl
  20. }, 5000);
  21. }
  22. }