Home Web Front-end HTML Tutorial What does the html noscript tag mean? How much do you know about the use of noscript tags?

What does the html noscript tag mean? How much do you know about the use of noscript tags?

Aug 23, 2018 pm 01:43 PM
html noscript

Let’s take a look together

html The definition and usage of the noscript tag:

The noscript element is used to define Alternative content (text) when the script is not executed.

This tag can be used by browsers that recognize the <script> tag but cannot support the script within it. </script>

HTML

##JavaScript

<body>
  ...
  ...
  <script type="text/javascript">
    <!--
    document.write("Hello World!")
    //-->
  </script>
    <noscript>Your browser does not support JavaScript!</noscript>
  ...
  ...
</body>
Copy after login

VBScript

<body>
  ...
  ...
  <script type="text/vbscript">
   <!--
   document.write("Hello World!")
   &#39;-->
  </script>
  <noscript>Your browser does not support VBScript!</noscript>
  ...
  ...
</body>
Copy after login

html The meaning and explanation of the noscript tag:

html The noscript tag is a quite old tag. The original purpose of its introduction was to help the old Smooth upgrade of browsers because early browsers did not support JavaScript. The noscript tag displays alternative content in browsers that do not support JavaScript. This element can contain any HTML element. The usage of this tag is also very simple:

<noscript>
  <p>本页面需要浏览器支持(启用)JavaScript</p>
</noscript>
Copy after login

However, by now, browsers that do not support Javascript should no longer appear, but users may also have disabled Javascript for various reasons. Such as saving traffic, extending battery life, or not wanting your privacy to be leaked by various statistics/tracking scripts. There are also quite a few users who have installed browser extensions like NoScript to prevent the browser from running Javascript.

Although the website cannot force users to enable Javascript in their browsers, it can prompt users that their browsers have disabled scripts to achieve a better user experience.

Recommended related articles: 1.
The difference between script tag and noscript tag in html ​      
Related video recommendations: 1.
Dugu Jiujian (1)_HTML5 video tutorial
For example, Fackbook prompts like this:

What does the html noscript tag mean? How much do you know about the use of noscript tags?

html The content in the elements in the noscript tag will only be displayed under the following circumstances:

  • The browser does not support scripts

  • The browser supports scripts, but scripts are disabled

If any of the above conditions are met, the browser will display the content in noscript. In other cases, the browser will not render the content in noscript.

Using the noscript tag can only convey a message to website users, that is, if Javascript is not enabled, the content and effects of the web page may not be fully rendered. But if some users don't know how to turn on Javascript, such prompt information will not be of any practical help to them. Therefore, we should still consider how to make such unconventional situations affect the user's browsing experience as little as possible without the support of Javascript (or HTML5, or other dependencies) at the beginning of website design.

Usage of noscript in HTML:

The noscript element is used to define alternative content (text) when the script is not executed. This tag can be used to identify the <script> element to define alternative content (text) when the script is not executed. tag but cannot support the script within it. If the browser supports scripts, the content of the noscript tag will not be displayed. <p></p><p>noscript tag usage example: <strong></strong><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot; /&gt;&lt;meta http-equiv=&quot;Content-Language&quot; content=&quot;zh-cn&quot; /&gt; &lt;/head&gt; &lt;body&gt; &lt;script type=&quot;text/javascript&quot;&gt; &lt;!--document.write(&quot;如果显示了这段文字,那么您的浏览器支持 JavaScript!&quot;)//--&gt;&lt;/script&gt; &lt;noscript&gt;No JavaScript support!&lt;/noscript&gt; &lt;p&gt;不支持 JavaScript 的浏览器将显示 noscript 元素中的文本。&lt;/p&gt; &lt;/body&gt; &lt;/html&gt;</pre><div class="contentsignin">Copy after login</div></div></p>Tips and Notes: <p></p>Note: If the browser supports scripts, it will not display the noscript element text in . <p></p>Note: Browsers that cannot recognize the <script> tag will display the content of the tag on the page. To prevent browsers from doing this, you should hide the script in comment tags. Older browsers (that don't recognize <script> tags) ignore comments and thus don't write the content of the tag to the page, while newer browsers know how to execute these scripts even if they are surrounded by comment tags. ! <p>【Editor's related articles】<p><p>html What does the col tag mean? Introduction to the usage examples of html col tag<a href="http://www.php.cn/div-tutorial-408815.html" target="_blank"><br/><p>Introduction to the style of html5 table tag (an example of html5 table css centering is attached)<a href="http://www.php.cn/html5-tutorial-408816.html" target="_blank"><br/></script>

The above is the detailed content of What does the html noscript tag mean? How much do you know about the use of noscript tags?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles