How To Redirect Page After Some Time In Javascript | Visual Studio Code

0


For current page

<html>
<head>
 <title></title>
</head>
<body>



<script>
 var timer= setTimeout(function() {
  window.location='http://google.com'
 },3000);


</script>
</body>
</html>


For open in new tab 



<html>
<head>
 <title></title>
</head>
<body>



<script>
 var timer= setTimeout(function() {
  window.open('http://google.com');
 },3000);


</script>
</body>
</html>

Post a Comment

Emoticon
:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top