A simple instance _php example of page delay jump using html/js/php method

Source: Internet
Author: User
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.

  • Related Article

    E-Commerce Solutions

    Leverage the same tools powering the Alibaba Ecosystem

    Learn more >

    Apsara Conference 2019

    The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

    Learn more >

    Alibaba Cloud Free Trial

    Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

    Learn more >

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.