

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to redirect if JavaScript is not enabled in a browser?
To redirect if JavaScript is not enabled in the web browser, add a script to the <noscript> tag. Let us say you need to redirect to index.php if JavaScript is not enabled.
Example
Here’s how you can do this:
<!DOCTYPE html> <html> <head> <title>HTML noscript Tag</title> </head> <body> <script> <!-- document.write("Hello JavaScript!") --> </script> <noscript> <style>html{display:none;}</style> <meta http-equiv="refresh" content="0.0;url=nojs/index.php”> </body> </html>
Above, we first use CSS style, since we do not want the actual page to be visible if JavaScript is disabled in the web browser.
- Related Questions & Answers
- How to detect if JavaScript is disabled in a browser?
- How to find out if the GPS of an Android device is enabled or not?
- How to find whether a browser supports JavaScript or not?
- JavaScript - Redirect a URL
- How to get information about network roaming is enabled or not in android?
- Checking if a button is enabled or disabled in SAP Application
- How to know if MySQL binary log is enabled through SQL command?
- How to redirect to another webpage using JavaScript?
- How to redirect to another webpage with JavaScript?
- JavaScript: How to return True if the focus is on the browser tab page?
- How to use JavaScript to redirect a webpage after 5 seconds?
- How to check if Location Services are enabled in iOS App?
- How to check if Location Services are enabled in Android App?
- How to use JavaScript to redirect an HTML page?
- How to use window.location to redirect to a different URL with JavaScript?
Advertisements