zoukankan      html  css  js  c++  java
  • 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.跳转新页面打开
          超链接<a href="http://www.jb51.net" title="脚本之家" target="_blank">Welcome</a>
          等效于js代码
          window.open("http://www.jb51.net"); 
    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> 
     
  • 相关阅读:
    字符串面试题:将句子的单词序倒置
    字符串面试题:将整型转换为字符串
    QML定时器
    QML按键事件处理
    QML鼠标事件实现变色矩形
    QML动态加载组件
    QML鼠标区域控制
    属性绑定与赋值
    设置虚拟机的本地端口映射
    关于修改banner信息;nginx反向代理apache应用
  • 原文地址:https://www.cnblogs.com/stone5/p/8998942.html
Copyright © 2011-2022 走看看