zoukankan      html  css  js  c++  java
  • javascript 自动跳转

    如何用javascript作自动跳转?
     
     
    ----------------
    <%@ page contentType="text/html;charset=gb2312" language="java" %>
     
    <body onLoad="directe()">
    .....
     
    <%
    String url=(String)session.getAttribute("url");
    if(url!=null){
    request.setAttribute("url",url);
    session.removeAttribute("url");
    }else{
    request.setAttribute("url","");
    session.removeAttribute("url");
    }
    %>
    <script language="javascript">
    function directe() {
    var url="<%=request.getAttribute("url")%>";
    if(window.opener==null){
    window.location.href="<%=request.getContextPath()%>"+url;
    } else{
    if(url==null||url.length==0){
    window.opener.location.href=window.opener.location.href;
    }else {
    window.opener.location.href="<%=request.getContextPath()%>"+url;
    }
    }
    }
    function preClose() {
    window.close();
    }
    setTimeout(preClose, 0);
    </script>
     
    </body>
     
  • 相关阅读:
    iOS-Core-Animation-Advanced-Techniques(一)
    vue 路由
    Vue 生产环境部署
    vue 单文件组件
    vue 插件
    Vue 混合
    vue 自定义指令
    vue render函数 函数组件化
    vue render函数
    vue 过渡状态
  • 原文地址:https://www.cnblogs.com/huapox/p/3516345.html
Copyright © 2011-2022 走看看