0%

html-tag-noscript

Introduction

noscript is used in following senarios:

  1. When the browser does not support JavaScript.
  2. When the browser has disabled JavaScript.

How to disable JavaScript in Chrome

  1. Open your page with Chrome.
  2. Press F12 to open the developer tools.
  3. Click on the three dots on the top right corner.(Or press Ctrl + Shift + P)
  4. Type disable JavaScript in the search bar.
  5. Click on the Disable JavaScript option.

When JavaScript was disabled, there will be a warning sign on Source tab. mouse hove on that warning sign, it will show the message JavaScript is disabled.

disable-javascript

Example

The following code will print Hello, world! in the console if JavaScript is enabled. If JavaScript is disabled, the message This page requires JavaScript. will be displayed.

1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
<body>
<script>
console.log('Hello, world!');
</script>
</body>
<noscript> This page requires JavaScript.</noscript>
</html>

As I know, currently, React framework will generate a noscript tag in the body tag when you create your project with create-react-app.

But Angular does not have a noscript tag in the body tag. there is no browser does not support JavaScript or disable JavaScript, so it is not necessary to add a noscript tag in the body tag.