我需要一个javascript来打开网址30秒,然后打开jsp文件

时间:2017-08-31 14:51:34

标签: javascript java html

我需要一个javascript,可以先打开一个URL进行rsa身份验证,然后打开jnlp.jsp文件。

到目前为止,我一直致力于此功能



function open_win() {
    window.open("http://ppsaccess/");
    setTimeout("window.location.href =\"https://****:8443/jnlp.jsp?port=8443&protocol=https:&serverName=***&commonMaintenanceTool=false\"><img",10000);
}
</script>
&#13;
&#13;
&#13;

这就是我得到的

&#13;
&#13;
<html>
<head>
<script type="text/javascript">
function open_win() {
    window.open("http://ppsaccess/");
}
setTimeout(function(){
    window.location.href ="https://***:8443/jnlp.jsp?port=8443&protocol=https:&serverName=***&commonMaintenanceTool=false\";
},10000);
</script>
</head>

<body>
<form>
<input type=button value="PR1" onclick="open_win()">
</form>
</body>

</html>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

尝试将设置超时行更改为闭包功能:

setTimeout(function(){
    window.location.href ="https://****:8443/jnlp.jsp?port=8443&protocol=https:&serverName=***&commonMaintenanceTool=false\"><img";
},10000);