如何用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>
 

相关文章:

  • 2021-09-10
  • 2021-09-18
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-05-27
  • 2022-01-18
  • 2022-02-08
  • 2021-06-20
相关资源
相似解决方案