Get the App
SLTechnology News&Howtos  ›  Development  › 

How js uses comments to prevent execution

Shulou Source: shulou.com Published: 2022-06-01 03:24:48 09月22日 Update

This article mainly introduces how js uses comments to prevent execution. It has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

Use comments to prevent execution

Using comments to prevent code execution is well suited to code testing.

Adding//before a line changes the executable line to a comment.

This example uses//to prevent execution of lines of code:

examples

//document.getElementById ("myH")[xss_clean] = "My first page";document.getElementById("myP")[xss_clean] = "My first paragraph. ";

This example uses comment blocks to prevent execution of multiple lines of code:

examples

/*document.getElementById("myH")[xss_clean] = "My first page";document.getElementById("myP")[xss_clean] = "My first paragraph. ";*/Thank you for reading this article carefully. I hope that Xiaobian's" How js uses comments to prevent execution "article will be helpful to everyone. At the same time, I hope that everyone will support it a lot. Pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

Tags: Comments code articles examples paragraphs pages values interests at the same time more friends knowledge editing industry information information channels channels multiple lines reference learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MariaDB Shulou Information macOS Shulou Tech Info