This article is a mirror article of machine translation, please click here to jump to the original article.

View: 2477|Reply: 0

[JavaScript] JS reverts the HTML entity encoding

[Copy link]
Posted on 4/29/2024 9:08:06 AM | | | |
HTML entity encoding is a method of converting special characters or symbols into HTML code. Since some characters in HTML have special meanings, using special code to represent these characters can avoid conflicts with HTML tags and ensure that the page is displayed normally.

Common HTML entity encoding

HTML entity coding includes basic entity coding and extended entity coding. Here are some commonly used HTML entity encodings:

  • < :< (under sign)
  • > :> (greater than sign)
  • & :& (& sign)
  •   :  (space)
  • © : © (Copyright symbol)
  • ® : ® (Registration Symbol)
  • "(Left double quotation marks)
  • ":" (right double quotation marks)


Sometimes, we don't need HTML entity encoding escapes, we need to revert the escaped code back (referencing jQuery) The code is as follows:







Previous:Font types TrueType and OpenType difference
Next:The frontend uses spark-md5 to calculate the file MD5 value
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com