Hide ID card information with js in the project, and hide ID card with js

Source: Internet
Author: User

Hide ID card information with js in the project, and hide ID card with js

Some Characters of the ID card are hidden through js in the project. The implementation of the computer version is to intercept the page. Now, the mobile version is used and you want to put the string in the background for operations, however, to ensure the consistency between the mobile and PC versions, you can use the following JavaScript code to write ftl pages:

<Html> <body> <script type = "text/javascript"> var html = '123456789abcdefghi'; var uw = html. replace (/(\ w)/g, function (a, B, c, d) {return (c> 1 & c <6) | c> (html. length-5 ))? '*': A}); document. write (uw); // The printed string 12 ***** 789abcde ***** </script> </body> 

Replace:
\ W indicates that it is used to match letters, numbers, and underline characters (but I have read an article that says that if a is in Russian, it can escape verification)
G indicates whether to replace the string globally. If not, only the first matched string is replaced.
Function (a, B, c, d) respectively indicates:
Matched string, variable value, matched string position in the original string (starting from 0), original string

======================================
Where do function (a, B, c, d) js parameters come from?
I searched the internet for half a day and found it an official Parameter definition. The test results for parameters are as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.