"Noscript" shows raw HTML when a page reloads without JavaScript.

I have a pop-up message that tells the user when JavaScript is disabled. The problem is happening in Chrome .

Here is a site with my <noscript> : Cloud9 Website . It is empty if you have JavaScript enabled. Here's how to duplicate my experience:

  • View a blank page.
  • Disable JavaScript.
  • Reload the page.

You should be able to see the raw HTML inside the <noscript> . If you reload the page, a message appears.

I also tested this locally with XAMPP: same thing.

This is my HTML:

 <noscript> <div class="nojs">This website requires JavaScript to run.&#160; Please<a href="activatejs.php"class="link" target="_blank">enable it</a> or use a web browser that supports JavaScript.</div> </noscript> 
+4
source share
1 answer

While this is a mistake, you can use this work:

 <div class="nojs"><noscript>This website requires JavaScript to run. Please </noscript><a href="activatejs.php"class="link" target="_blank"><noscript>enable it</noscript></a><noscript> or use a web browser that supports JavaScript.</noscript></div> 
0
source

Source: https://habr.com/ru/post/1491293/


All Articles