Web development often encounter page jump or delay jump demand, master a variety of page jump method is very necessary.
Here is my summary of useful html/js/php three ways to implement the Jump method, examples are three seconds after the jump to the index.php page.
1,html Method:
Add <meta> tags to HEAD
<http-equiv=content="3;url= ' index.php '" >
2,js Control Jump Method
A.location Direct Add Link method
<type="Text/javascript" > setTimeout ("window.location= (' index.php '"); </script>
B.location.href Way
<type="Text/javascript" > setTimeout ("window.location.href= ' index.php '", 3000); </script>
C.location.assign Way
<type="Text/javascript" > setTimeout ("window.location.assign (' index.php ')", 3000); </script>
D.location.replace Mode (Note that the page is "replaced" and will not be queried in the browser's history)
<type="Text/javascript" > Widdow.location.replace (' index.php '); </script>
E.js history Go (n) mode (n indicates the number of steps forward for the history relative to the current page, and n is a negative representation to return to the previous page)
<type="Text/javascript" > window.history.go (n); </script>
F.js history Go (URL) way (note that the URL must be in the history, otherwise the page will not jump)
<type="Text/javascript" > window.history.go (' index.php '); </script>
G.js window.open Way to achieve jump by opening a new window. (Its second property is an optional target option, the value can be frame id/_blank, etc., the third option is the specific setting options for the new popup, including Height/width, etc.)
<type="Text/javascript" > setTimeout ("window.open (' index.php ', Target,args)", 3000); </script>
3, PHP script control jump mode, by overwriting the HTTP header information to jump
A.header Refresh mode:
Header ("Refresh:3;url= 'index.php '");
B. Header Location Mode:
Sleep (3); Header ("Location:index.php");
Note that this will cause the current page to not be entered. Even if currently in the Register.php page link to login.php page, login.php page with header location to jump, the page will be directly from the register.php page three seconds to jump to index.php, will not enter the L ogin.php page, this is because the header location redirects the page.
If there is any mistake, please correct me, thank you.
Using html/js/php method to implement page delay jump