密码强度检测函数(正则)
OA登录
function showImage(){
var imgObj=new Image(); //创建一个Image对象
imgObj.src="http://www.beingmate.com/images/banner_chang_add.gif"; //装载Image源
if(typeof(imgObj)=="object"){ //判断imgObj装载过后是否为对象,防止异常操作
var width=0;
var height=0;
width=imgObj.width+20; //+20是因为IE方式的默认边距
height=imgObj.height+20;
if(width!=0&&height!=0){
window.open(imgObj.src,"Imagehow", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" +( width )+ ",height=" +( height));
}else{
setTimeout("showImage()", 100); // 判断图片是否装载完成,只有在装载完成后才能取到宽高值
}
}else{
alert("系统错误");
}
}
//showImage();
//From BBS.51JS.COM By 网络东西
var $ = function(v){return document.getElementById(v);}
function isSecurity(v){
if (v.length 0){lv--;}
iss.reset();
switch(lv) {
case 0:
iss.level0();
break;
case 1:
iss.level1();
break;
case 2:
iss.level2();
break;
default:
iss.reset();
}
}
var iss = {
color:["CC0000","FFCC33","66CC00","CCCCCC"],
text:["弱","中","强"],
width:["50","100","150","10"],
reset:function(){
$("B").style.backgroundColor = iss.color[3];
$("B").style.width = iss.width[3];
$("A").innerHTML = "";
},
level0:function(){
$("B").style.backgroundColor = iss.color[0];
$("B").style.width = iss.width[0];
$("A").innerHTML = "密码较弱";
},
level1:function(){
$("B").style.backgroundColor = iss.color[1];
$("B").style.width = iss.width[1];
$("A").innerHTML = "中";
},
level2:function(){
$("B").style.backgroundColor = iss.color[2];
$("B").style.width = iss.width[2];
$("A").innerHTML = "高强";
}
}
|
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]