tags:

views:

22

answers:

1

I am developing a project in Java.

I want to start with a welcome page where I put a syntax of page redirecting. But, I want to display welcome page, 2 seconds and then redirect it.

What should be syntax?

+2  A: 

Use a meta refresh tag (url value can be either relative or absolute):

<meta http-equiv="refresh" content="2;url=nextpage.html" />

Another option would be to use a JavaScript timeout and change the value of window.location to the desired address (this can be relative or absolute as well). Use an event handler to do this when the page has loaded, or put something like this right before you close your <body> tag:

<script type="text/javascript">
  setTimeout(function() { window.location = 'nextpage.html'; }, 2000);
</script>
Lauri Lehtinen