html Redirection is to use various methods to reorient network requests to other locations . In the construction of the website , Often encounter the need for web page redirection : Like website adjustment , Such as changing the structure of the web directory , The page was moved to a new address , Or , Page extension changed , If the application requires .php Change to .Html or .shtml, under these circumstances , If you don't redirect , Then the old address in the user's favorite or search engine database can only let the visiting customer get a 404 Page error message , Loss of traffic ; Another example is that some websites have registered multiple domain names , You also need to redirect users who visit these domains to jump to the main site automatically , wait .
The first one is :
<script language="javascript"type="text/javascript">
window.location.href="http://shanghepinpai.com";
</script>
The second kind :
<script language="javascript">
alert(" return ");
window.history.back(-1);
</script>
The third kind of :
<script language="javascript">
window.navigate("http://shanghepinpai.com");
</script>
A fourth :
<script language="JavaScript">
self.location='http://shanghepinpai.com';
</script>
The fifth :
<script language="javascript">
alert(" Illegal access !");
top.location='http://shanghepinpai.com';
</script>
html in meta Tag implementation
Just in head Add the following sentence to it , Stay on the current page 0.1 Jump to the target page in seconds
<meta http-equiv="refresh" content="0.1; url=http://jb51.net/">
php Realization
<?php
header("Location: http://jb51.net/");
?>
A good Web Front end development engineers should have breadth in knowledge system , There's also depth , So it's hard for many big companies to recruit ideal front-end development engineers even if they pay high salaries . So how to systematically learn the practical web Front end technology , For this purpose, a web Front live class learning buckle skirt ,web The number in front of the front end is 767 ,web The number in the middle of the front end is 273 ,web The front end is zero one two , Just connect the numbers . Those who really want to learn can enter , Don't waste your time on soy sauce makers . Now the point is not to explain technology , It's more about explaining the skills . Technology is not black or white , Only right and wrong , And the skill is different .