Introduction
noscript
is used in following senarios:
- When the browser does not support JavaScript.
- When the browser has disabled JavaScript.
How to disable JavaScript in Chrome
- Open your page with Chrome.
- Press
F12
to open the developer tools. - Click on the
three dots
on the top right corner.(Or pressCtrl + Shift + P
) - Type
disable JavaScript
in the search bar. - 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
.
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 |
|
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.