Home > Web Front-end > HTML Tutorial > The html noscript tag is an important tag that has been overlooked

The html noscript tag is an important tag that has been overlooked

黄舟
Release: 2017-06-30 10:33:49
Original
1701 people have browsed it

Open the new backend of Drupal and find that a large area of ​​​​blank space is displayed

. I thought it was a CSS problem, but after struggling for a long time, I found out that I had disabled the Javascript in the browser due to security issues on some sites. The increasing power of Javascript makes our web pages richer and more colorful, the interactions more and more powerful, and the functions more and more dazzling. However, some web page effects are completely dependent on Javascript. Once without the support of Javascript, even the basic content may not be fully displayed. At this time, our old and strong noscript tag should come out.

The noscript tag is a A fairly old tag that was originally introduced to help smooth the upgrade of older 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 similar to 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. For example, Fackbook prompts like this:

The html noscript tag is an important tag that has been overlookedThe 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.

Written at the end

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 as little as possible without the support of Javascript (or

HTML5

, or other dependencies) at the beginning of the website design. experience.

The above is the detailed content of The html noscript tag is an important tag that has been overlooked. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template