Redirecting Browser to a page if JavaScript support is not there

If you have developed a page which depends on JavaScript for form validation or for any other purposes then you would be interested in detecting the setting of the client browser and would like to redirect to a different page explaining how to enable or disable JavaScript. Here we will discuss how to check this setting and redirect to a different page accordingly. We can detect this by using noscript tag and if the JavaScript is disabled then the code within this noscript tag will be executed. Here is the code to do that. This code will detect if the script setting is disabled and will redirect to a page explaining how to enable or disable JavaScript. This code will will also redirect the page with meta refresh in 2 seconds.

Demo of javaScript support and redirecting

Here is the code
<title>Demo of Checking if JavaScript is enabled in web browser</title>
<body >
<meta http-equiv="refresh" content="2; URL=enable_javascript.php">
Are you using a browser that doesn't support JavaScript?<br><br>

If your browser does not support JavaScript, you can upgrade to a newer browser<br><br>

If you have disabled JavaScript, you must re-enable JavaScript to use this page. To enable JavaScript:

If you are not seeing any message above this line then you have JavaScript enabled in your browser.
In the above code check this line
<meta http-equiv="refresh" content="2; URL=enable_javascript.php">
This line redirects the browser to a different page after 2 seconds. You can change the time duration by changing 2 seconds to any other value.
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net



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


    meta tags can be disabled in some browsers.


    No, meta tags can't be disabled..

    Post your comments , suggestion , error , requirements etc here .

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