283383765pw

HTML的实现

<head>
<!-- 以下方式只是刷新不跳转到其他页面 -->
<meta http-equiv="refresh" content="10">
<!-- 以下方式定时转到其他页面 -->
<meta http-equiv="refresh" content="5;url=hello.html"> 
</head>

 

JavaScript的实现 

<script language="javascript" type="text/javascript">
  // 以下方式直接跳转
  window.location.href=\'hello.html\';
  // 以下方式定时跳转   setTimeout("javascript:location.href=\'hello.html\'", 5000); </script>

 

利用倒数动态提示

//非firfox
<span id="totalSecond">3</span> <script language="javascript" type="text/javascript">   var second = totalSecond.innerText;   setInterval("reDirect()", 1000);   function reDirect(){     totalSecond.innerText=--second;     if(second<0) location.href=\'hello.html\';   } </script>


//firfox

<script language="javascript" type="text/javascript">
  var second = document.getElementById(\'totalSecond\').textContent; 
  setInterval("redirect()", 1000);
  function redirect(){
    document.getElementById(\'totalSecond\').textContent = --second;
    if (second < 0) location.href = \'hello.html\';
  }
</script>

 

分类:

技术点:

相关文章:

  • 2022-01-08
  • 2022-02-08
  • 2021-12-31
  • 2022-02-08
  • 2021-11-27
猜你喜欢
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-09-29
相关资源
相似解决方案