简单的jquery对 密码 框的密码进行 混淆
1 /** 2 * 密码混淆器 3 */ 4 $.fn.enKey = function(size){ 5 var size = (size === undefined || isNaN(size)) ? 4 : size; 6 var self = this; 7 this.keyup(function(event){ 8 var charAll = "0123456789abcdefghijklmnop"+ 9 "qrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 10 var changValue = function(value){ 11 var charResult = ""; 12 var charArray = charAll.split(""); 13 var charLen = charArray.length; 14 for(var i = 0 ; i < size ; i++){ 15 var randValue = Math.floor(Math.random()*charLen); 16 charResult += charAll[randValue]; 17 } 18 return (charResult); 19 } 20 if( (65<=event.keyCode && event.keyCode<=90) || 21 (48<=event.keyCode && event.keyCode<=57) || 22 (96<=event.keyCode && event.keyCode<=105)){ 23 self.val(self.val()+changValue(event.keyCode)); 24 } 25 }) 26 } 27 28 29 30 $("input[name='password']").enKey(2);
----走出会议室,只有执行力
解决问题是衡量能力的标准。