org.sonar.l10n.web.rules.Web.MetaRefreshCheck.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-web-plugin Show documentation
Show all versions of sonar-web-plugin Show documentation
Analyze HTML (also within PHP/Ruby/etc. templates) and JSP/JSF code.
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 - 2025 Weber Informatics LLC | Privacy Policy