How to implement a Web timed refresh or jump using meta in CSS

Source: Internet
Author: User

Meta-source information function of page timing jump and Refresh

Almost all of the page headers have <meta> source information. In addition to our commonly used definition encoding, keyword (name= "keywords"), description (name= "description") (for SEO), you can also define viewport size, scaling ratio, etc. (for mobile end), as follows:

CSS code to copy content to clipboard
    1. <meta name= "viewport" content= "width=device-width,initial-scale=1.0" >

Also, define the expiration time of the Web page, the expiration time of the cookie, and so on.
is our web page normal jump, also can use <meta> implementation, the following several typical code examples:

CSS code to copy content to clipboard
    1. <meta http-equiv= "Refresh" content= "5" >

This means that the current page is brushed every 5 seconds, brush it

CSS code to copy content to clipboard
    1. <meta http-equiv= "Refresh" content= "2; Url= '/' ">

This represents the current page 2 seconds after the jump to the homepage ~

<meta http-equiv= "Refresh" content= "0; Url= ' http://www.qq.com/' ">

Page jump directly to Tencent Net ~

So, the next time we encounter the "login successful, is jumping to your previous page ...", you can use the <meta> refresh, jump function, can be said to be the lowest cost.

The above demo effect is the 1th example code effect above.

According to my tests, this feature, including IE7, is supported by browsers.
Here's the question: Why does meta jump not fire?

You can see, meta jump, easy to use, do not write JS, do not have to the background code, timed jump refresh what play so very well, and compatibility is good, why always feel tepid, rarely see someone mentioned it?

The new young partner did not know has heard such a word, called "the evil IE6 age".

It is said that that year, this batch of old browser, a lot of problems, of which there is a little unfriendly to meta2. I also heard that not necessarily accurate. The rumor is that:

    • Time set to 0 jump, sometimes the page will flash;
      Jump to other pages, the browser Back button is not available;

But Ah, now what age, prison situation has been filmed in the second season, these old problems, I think can be ignored.

Might as well try a meta jump, make good use of the native characteristics of the browser, you may find more than what JS Jump stream use more happy.

Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.