Home  >  Article  >  Web Front-end  >  How to use JavaScript to implement pop-up warnings

How to use JavaScript to implement pop-up warnings

不言
不言Original
2018-12-15 17:31:406365browse

When we browse the web, we may encounter that a certain web page cannot be accessed or is unsafe to access. At this time, a warning dialog box will pop up. So, what can we do with this pop-up dialog box? What about implementation? This article will introduce to you how to use How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings to implement this pop-up warning. Let’s look at the specific content below.

How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings

It is very simple to implement this kind of pop-up warning using How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings. Let’s take a look at the specific example

To use How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings to display the alert , just write the following code

alert('要显示的字符串,值');

The complete code is as follows

<!DOCTYPE html>
<html lang = "ja">
  <head>
    <meta charset = "utf-8">
    <title>How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings</title>
  </head>
  <body>
    <script>
      alert(&#39;警告!!!&#39;);
    </script>
  </body>
</html>

The running effect is as follows: When using the browser to load the file, nothing will be displayed on the browser, but the following will be displayed on the page pop up

How to use How to use JavaScript to implement pop-up warnings to implement pop-up warnings

The above is the detailed content of How to use JavaScript to implement pop-up warnings. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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