Detect Disabled JavaScript with noscript and Fallback Content

If a page depends on JavaScript, provide a usable fallback or a clear message for visitors who have scripts disabled. The HTML <noscript> element is designed for content that should appear when scripting is unavailable.

The original Plus2net example also redirected visitors to instructions for enabling JavaScript. That facility is preserved in the demo.

Demo of JavaScript support and redirecting

On this page

Using <noscript> Top ↑

When scripting is enabled, the normal JavaScript runs. When scripting is disabled, content inside the body-level <noscript> is shown. The demo also places a meta refresh inside a head-level <noscript> so the original redirect behavior remains available without JavaScript.

<noscript>
  JavaScript is disabled. <a href="enable_javascript.php">Enable JavaScript</a>.
</noscript>

Complete working source Top ↑

This source matches the modernized demo and remains directly copyable as one page.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>JavaScript support demo</title>
<noscript>
<meta http-equiv="refresh" content="10; URL=enable_javascript.php">
</noscript>
</head>
<body>
<h1>JavaScript support check</h1>
<p id="jsStatus">Checking JavaScript status…</p>
<noscript>
<p>JavaScript is disabled. This page will redirect to the JavaScript enabling instructions in 10 seconds.</p>
<p><a href="enable_javascript.php">Open the instructions now</a>.</p>
</noscript>
<script>
document.getElementById("jsStatus").textContent = "JavaScript is enabled in this browser for this page.";
</script>
<p><a href="javascript_support.php">Return to the JavaScript support tutorial</a></p>
</body>
</html>

Do not make JavaScript failure a dead end Top ↑

Whenever practical, core information and navigation should still be available without JavaScript. If a feature truly requires scripting, explain what is unavailable and provide a direct route to the browser-setting instructions rather than leaving a blank page.

JavaScript Basic




Subscribe to our YouTube Channel here



plus2net.com







Amirreza

27-06-2014

Perfect method!
Used on my webiste,It fully works without any errors!
soma

02-08-2016

meta tags can be disabled in some browsers.
smo1234

02-10-2016

No, meta tags can't be disabled..



✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer