Problem Statement: A User clicks on a button. It opens a new webpage in a new window. We check if the user has spent 5 seconds on this newly opened page. If yes, then page provides a link to another webpage. At last, the new webpage appears when the user clicks on the button. is it possible to do this in Javascript?
Things I know:
HTML:
<button onclick="timerPage()">Click me </button>
Javascript (in the head of the website)
<script type="text/javascript">
function timerpage()
{
window.open("timerPageUrl");
/* I believe after this point we don't have any control on this window.
Please correct me if I am wrong.
*/
}
</script>
I am able to create a "timer page with a click" separately but merging these two into one seems near to impossible to me. Well, I need some help.