2016-04-19 12 views

Antwort

2

prüfen Arbeitsbeispiel

$(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 = '[email protected]'; 
 
    // 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>