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
- <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
- <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
- <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.