<html class="no-js"> <head> <style> .error, .no-js #container { display: none; } .no-js .error { display: block; } </style> <script> document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/, ''); </script> </head> <body> <div id="container"> rest of page </div> <div class="error"> sorry, no javascripty, no sitey! </div> </body> </html>
Of course, this is usually a bad idea, but I hope you already thought that.
source share