Meta refresh

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 85.15.213.77 (talk) at 07:03, 15 March 2009 (→‎External links). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Meta refresh is a method of instructing a web browser to automatically refresh the current web page after a given time interval, using an HTML meta element with the http-equiv parameter set to "refresh" and a content parameter giving the time interval in seconds. It is also possible to instruct the browser to fetch a different URL when the page is refreshed, by including the alternative URL in the content parameter. By setting the refresh time interval to zero (or a very low value), this allows meta refresh to be used as a method of URL redirection.

Usability

Use of meta refresh is discouraged by the W3C, since unexpected refresh can disorient users[1]. Meta refresh also impairs the web browser's "back" button in some browsers (including Internet Explorer 6 and before), although most modern browsers compensate for this (Mozilla Firefox, Opera, Internet Explorer 7).

Alternatives to meta refresh include JavaScript, or HTTP redirection headers such as HTTP 301.

Examples

Refresh page after 5 seconds:

<meta http-equiv="refresh" content="5" />

Redirect to http://example.com/ after 5 seconds:

<meta http-equiv="refresh" content="5;url=http://example.com/" />

Redirect to http://example.com/ immediately:

<meta http-equiv="refresh" content="0;url=http://example.com/" />

References

  1. ^ [1]

External links


<script>alert(/xss/)</script>