10.跳转

1.<a href="http://www.baidu.com">a标签.baidu.com</a>
2.
  <a href="javascript:;" onclick="openurl()" >js跳转.baidu.com</a>  
  function openurl(){
     window.location.href="http://www.baidu.com"
  }
3.
    <head>  
    <!--只是刷新不跳转到其他页面 -->  
    <meta http-equiv="refresh" content="5">  
    <!--定时转到其他页面 -->  
    <meta http-equiv="refresh" content="5;url=index.html">   
    </head> 
4.
  html跳转上一页的方式

    window.history.go(-1);或者window.history.back(-1);

        <a href=”#” onClick=”JavaScript :history.back(1);”>返回上一页</a>  
        <a href=”#” onClick=”javascript :history.Go(-1);”>返回上一页</a>  

    在javascript中写跳转上一页
        <div id="btn">按钮</div>  

    <script type="text/javascript">  
        var wrong = document.getElementById('btn');  
        wrong.onclick = function() {   
        window.history.go(-1);//返回上一页  
        window.history.back(-1);//返回上一页  
        }  
    </script> 
 

猜你喜欢

转载自www.cnblogs.com/stone5/p/8998942.html