1

I need a javascript which can 1st open a url for rsa authentication and then open the jnlp.jsp file.

I worked on this function so far

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>

This what I got

<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>
Raju435675
  • 13
  • 3
  • 1
    I'm just wondering why `php` is tagged when `jsp` is involved? – Rajesh Aug 31 '17 at 14:54
  • 1
    Unrelated to your question, but please ___[don't call `setTimeout` with a string as parameter](https://stackoverflow.com/questions/6081560/is-there-ever-a-good-reason-to-pass-a-string-to-settimeout)___! – Cerbrus Aug 31 '17 at 14:55

1 Answers1

0

Try changing the set timeout line to be a closure function:

setTimeout(function(){
    window.location.href ="https://****:8443/jnlp.jsp?port=8443&protocol=https:&serverName=***&commonMaintenanceTool=false\"><img";
},10000);
delboy1978uk
  • 12,118
  • 2
  • 21
  • 39
  • just tried it
    d and it didn't work.
    – Raju435675 Aug 31 '17 at 16:19
  • @Raju435675 Maybe use a fiddle and link to that..very hard to read code in a comment. – Tom O. Aug 31 '17 at 16:25
  • you are escaping the closing `"` – delboy1978uk Sep 06 '17 at 08:21