- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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.
Advertisements