Skip to content Skip to sidebar Skip to footer

Automatically Close Current Window And Open New Window With New URL Address

I was using following code for auto close current window and open new window with the new URL in the variable. There is something wrong with the code, not working anymore it is clo

Solution 1:

you do know that http://www.myweb.com/weather_control.php is dead page, right? Try to use this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv="prahma" content="no-cache">
<title>Auto Close and Open New window</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="javascript">
  var url = "http://www.myweb.com/weather_control.php?"+Math.random()
  window.open(url,"","MyTitle");
  window.open('', '_self', ''); 
</script>

</head>
<body onload="setTimeout(function(){window.close();},2000)">
</body>
</html>

Solution 2:

Try this

<html>
  <head>
    <script>
      function gio() {
        popup = window.open('http://www.wholewordz.cf/2017/02/kenya-says-it-will-shut-worlds-biggest.html');
        setTimeout( 5000);
      }
    
      function closed(){
        setTimeout("window.close()", 500);
      }
    
      function call() {
        popup = window.open('http://www.google.co.in');
        setTimeout(wait, 8000);
      }
    
      function caller() {
        setInterval(call, 12000);
      }
    
      function wait() {
        popup.close();
        closed();
      }
    </script>
  </head>
  <body onload="caller(); gio();">
  </body>
</html>

Post a Comment for "Automatically Close Current Window And Open New Window With New URL Address"