When I try to go to Gmail and FaceBook with my JavaScript disabled, I am greeted with the following:
The content in the images is displayed in <noscript>
tags, but the rest of the usual page content isn't there. The Gmail source has a few empty <iframe>
elements, but the FB page is empty, save for the <noscript>
element, and a couple <script>
tags.
I would like to have similar behaviour for my site, but am unsure how to only load the page content if the user has JS enabled. I can put in the <noscript>
element, and have a div centred on screen with a "You need JS enabled" message, but the rest of the content would still have loaded behind it.
There are a couple solutions here and here, but they only have the main content as:
display: none;
and the set it to block;
via JS. But that would still show up in the source.
Can I entirely prevent loading page content when JS is disabled, and only display the "Oops, you need JS enabled" message?