How to redirect an user with a URL in HTML?

 Posted by Pgayath on 9/21/2012 | Category: HTML 5 Interview questions | Views: 1615 | Points: 40
Answer:

The <meta> tag with "http-equiv" and "content" attribute is used to redirect an user automatically to a website.

Let us see an example with dotnetfunda site.

<html>

<head>
<meta http-equiv="Refresh" content="5;url=http://www.dotnetfunda.com" />
</head>
<body>
<h1>Sorry! We have moved!</h1>
<h2>The new URL is: <a href="http://www.dotnetfunda.com">http://www.dotnetfunda.com</a></h2>
<p>You will be redirected to the new address in five seconds.</p>
<p>If you see this message for more than 5 seconds, please click on the link above!</p>
</body>
</html>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response