How To Redirect From A HTML Page




Here we consider How To Redirect From A HTML Page. We can do this using HTML meta Refresh and JavaScript. Lets consider both in detail.




We can use HTML meta Refresh as follows.

How To Redirect From A HTML Page, Redirect From A HTML Page, Redirect From A HTML Page Using Meta Refresh, Redirect From A HTML Page Using JavaScript, HTML Meta Refresh, JavaScript Redirection, Reload Using HTML Meta Refresh, HTML, Asp.Net, PHP

The above code should be placed on the head section. Here content = 0 means to refresh the page after 0 seconds. Give the user some more time before redirection by increasing the value. But use of meta refresh is discouraged by the World Wide Web Consortium (W3C). Incase JavaScript is disabled, we can redirect page using this way.




There are several ways that we can redirect page using javascript. Best two ways are given below.



The best preferred will be window.location.replace

This is because, window.location.replace simulates the HTTP Redirect absolutely. More information about the JavaScript Redirection can be found in the following link. Redirect Page Using Javascript