jsp页面等等几秒后,自动运行javascript中的函数!!!!

jeff1114 jeff1114 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
代码是:

<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'Extractpage.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<style type="text/css">
.white_content {
display: block;
position: absolute;
top: 25%;
left: 35%;
width: 25%;
height: 8%;
padding: 1px;
border: 1px solid #51b2f6;
background-color: white;
z-index:1002;
overflow: auto;
}

</style>

</head>
<%
String type=(String)request.getAttribute("type");
%>
<script>
var type='<%=type%>';
function extract()
{
if(type=="yuqing")
{
document.myform.action="../ExtractYuqing.jsp";
document.myform.submit();
}else if(type=="taskevent")
{
document.myform.action="../SearchAllEvent?method=sourceShow";
document.myform.submit();
}
}
extract();
</script>
<body>
<form action="" id="myform" name="myform" method="post">

<div id="light" class="white_content" align="center">
<img src='img/loading.gif' width='160' height='20' />
<br>
正在处理中,请稍候...
</div>
</form>
</body>
</html>



现在需要的是,进入这个页面后,等待5秒后,自动运行 extract()函数,从而进行页面的跳转,请问怎么实现啊
在网上找的方法是 <meta http-equiv="refresh" content="5;URL=http://www.baidu.com"> 但这个方法只能跳转到固定的网址,不能运行js中的函数!!!
...全文

相关推荐

评论 12
收藏 已收藏
分享
返回顶部
jeff1114
Web 开发 81,108 成员 341,721 内容