What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

Beginner level using html, seeking a little help

PeterR

New member
Hello all! My name's Peter Richards, based in
Canada. I joined this forum a few minutes ago.

I'm hoping to find a little helpful direction
with a 15 line index.html file I'm trying out
(as a beginner level person learning html).
What I'm trying to do is get my script to load
google.com page then close tab after 8 seconds.

Frustratingly, my script was doing the 8000 ms
delay 1st and loading of google.com page 2nd.
If anyone has a useful suggestion, thank you.

<!DOCTYPE html>
<html>
<head>
<title>Script title</title>
</head>
<body>
<script>
function redirectFunc() {
window.open("https://www.google.com");
}
setTimeout("redirectFunc()", 8000);
//window.close();
</script>
</body>
</html>
 
Back
Top