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 tags to head
2,js Control Jump Method
A.location Direct Add Link method
B.location.href Way
C.location.assign Way
D.location.replace Mode (note that the page is "replaced" and will not be queried in the browser's history)
E.js History Go (n) mode (n indicates the number of steps forward for the history relative to the current page, andn is a negative representation to return to the previous page)
F.js History Go (URL) Way (note that the URL must be in the history, otherwise the page will not jump)
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., and the third option is the specific setting options for the new popup, including the height/width , etc.)
3,php script to control the 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 is currently linked to the login.php page in the register.php page , thelogin.php page is used Header location mode to jump, the page will be directly from the register.php page wait three seconds to jump to index.php, will not enter the login.php page, this is because the header location redirects the page.
If there is any mistake, please correct me, thank you.
The above this article uses the html/js/php way to realize the page delay jump The simple example is the small part to share to everybody's whole content, hoped can give everybody a reference, also hoped that everybody supports the script home.