【发布时间】:2016-04-19 09:58:47
【问题描述】:
示例。
raju327@gmail.com
9999888877
输出
rajuXXX@gmail.com
999XXXX877
还有核心我想使用 OTP 功能来修复按钮单击 OTP 密码只有客户应该更改用户名和密码。
【问题讨论】:
-
请分享更多示例和您的尝试?
标签: javascript jquery drupal drupal-7 drupal-6
示例。
raju327@gmail.com
9999888877
输出
rajuXXX@gmail.com
999XXXX877
还有核心我想使用 OTP 功能来修复按钮单击 OTP 密码只有客户应该更改用户名和密码。
【问题讨论】:
标签: javascript jquery drupal drupal-7 drupal-6
检查工作示例,
$(document).ready(function () {
MobEncrypt();
EmailEncrypt()
});
function MobEncrypt() {
var value = '9999888877';
// make a string with x-characters
var x = new Array(value.length - 3).join('X');
// join this string with the tail of the value, and replace it
alert(x + value.substr(value.length - 3));
}
function EmailEncrypt() {
var value = 'raju327@gmail.com';
// make a string with x-characters
var x = new Array(value.length - 5).join('X');
// join this string with the tail of the value, and replace it
alert(x + value.substr(value.length - 5));
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
【讨论】: