来自Google的密码强度Javascript验证代码

  1 <script type=”text/javascript”>

  2 var agt = navigator.userAgent.toLowerCase();

  3 var is_op = (agt.indexOf(“opera”) != -1);

  4 var is_ie = (agt.indexOf(“msie”) != -1) && document.all && !is_op;

  5 var is_ie5 = (agt.indexOf(“msie 5”) != -1) && document.all && !is_op;

  6

  7 function CreateXmlHttpReq(handler) {

  8   var xmlhttp = null;

  9   if (is_ie) {

 10     var control = (is_ie5) ? “Microsoft.XMLHTTP” : “Msxml2.XMLHTTP”;

 11     try {

 12       xmlhttp = new ActiveXObject(control);

 13       xmlhttp.onreadystatechange = handler;

 14     } catch (ex) {

 15       alert(“You need to enable active scripting and activeX controls”); 

 16     }

 17

 18   } else {

 19     xmlhttp = new XMLHttpRequest();

 20     xmlhttp.onload = handler;

 21     xmlhttp.onerror = handler;

 22   }

 23   return xmlhttp;

 24 }

 25

 26

 27 function XmlHttpPOST(xmlhttp, url, data) {

 28   try {

 29     xmlhttp.open(“POST”, url, true);

 30     xmlhttp.setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded; charset=UTF-8”);

 31     xmlhttp.send(data);

 32

 33   } catch (ex) {

 34     // do nothing

 35   }

 36 }

 37

 38

 39 var myxmlhttp;

 40 ratingMsgs = new Array(6);

 41 ratingMsgColors = new Array(6);

 42 barColors = new Array(6);

 43

 44 ratingMsgs[0] = “太短”;

 45 ratingMsgs[1] = “弱”;

 46 ratingMsgs[2] = “一般”;

 47 ratingMsgs[3] = “很好”;

 48 ratingMsgs[4] = “极佳”;

 49 ratingMsgs[5] = “未评级”;

 50

 51 ratingMsgColors[0] = “#676767”;

 52 ratingMsgColors[1] = “#aa0033”;

 53 ratingMsgColors[2] = “#f5ac00”;

 54 ratingMsgColors[3] = “#6699cc”;

 55 ratingMsgColors[4] = “#008000”;

 56 ratingMsgColors[5] = “#676767”;

 57

 58 barColors[0] = “#dddddd”;

 59 barColors[1] = “#aa0033”;

 60 barColors[2] = “#ffcc33”;

 61 barColors[3] = “#6699cc”;

 62 barColors[4] = “#008000”;

 63 barColors[5] = “#676767”;

 64

转载请注明:代码学堂>编程开发 > 正则学习 > 来自Google的密码强度Javascript验证代码

1. 本站所有资源来源于用户上传和网络,因此不包含技术服务请大家谅解!如有侵权请邮件联系客服!10210454@qq.com
2. 本站不保证所提供所有下载的资源的准确性、安全性和完整性,资源仅供下载学习之用!如有链接无法下载、失效或广告,请联系客服处理,有奖励!
3. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!如用于商业或者非法用途,与本站无关,一切后果请用户自负!
4. 如果您也有好的资源或教程,您可以投稿发布,成功分享后有RB奖励和额外RMB收入!

磊宇堂正在使用的服务器 维护管理由磊宇云服务器提供支持

磊宇堂 » 来自Google的密码强度Javascript验证代码

提供最优质的资源集合

立即查看 了解详情