org.sonar.l10n.web.rules.Web.MetaRefreshCheck.html Maven / Gradle / Ivy
The newest version!
Use of <meta http-equiv="refresh">
is discouraged by the World Wide Web Consortium (W3C).
If a user clicks the 'Back' button, some browers will go back to the redirecting page, which will prevent the user from actually going back.
To refresh the page, a better alternative is to use Ajax, to refresh only what needs to be refreshed and not the whole page.
To redirect to another page, using the HTTP response status code 301 'Moved Permanently' and 302 'Found' is a better option.
Noncompliant Code Example
<head>
<meta http-equiv="refresh" content="5"> <!-- Non-Compliant -->
<meta name="description" content="...">
</head>
Compliant Solution
<head>
<meta name="description" content="...">
</head>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy