Tuesday, 21 November 2017

Redirect website after certain amount of time


Redirect website after certain amount of time

Sol 1:


    
         http-equiv="refresh" content="3;url=http://www.somewhere.com/" />
    

ContentMiddleAd


Redirecting in 3 seconds...
Note that use of meta refresh is deprecated and frowned upon these days, but sometimes it's the only viable option (for example, if you're unable to do server-side generation of HTTP redirect headers and/or you need to support non-JavaScript clients etc).
Sol 2:
If you want greater control you can use javascript rather than use the meta tag. This would allow you to have a visual of some kind, e.g. a countdown.
Here is a very basic approach using setTimeout()

ContentMiddleAd


    
    You will be redirected in 3 seconds

ContentMiddleAd



Sol 3:

ContentMiddleAd

Here's a complete (yet simple) example of redirecting after X seconds, while updating a counter div:


    
id="counter">5

The initial content of the counter div is the number of seconds to wait.
Sol 5:


ContentMiddleAd

Place the following HTML redirect code between the and tags of your HTML code.
The above HTML redirect code will redirect your visitors to another web page instantly. The content="3; may be changed to the number of seconds you want the browser to wait before redirecting. 4, 5, 8, 10 or 15 seconds, etc.

Sol 6:

 http-equiv="refresh" content="3;url=http://www.google.com/" />

1 comment:

  1. really Good blog post.provided a helpful information.I hope that you will post more updates like thisHadoop Admin Online Course India

    ReplyDelete