$(document).ready(function() { var u = navigator.userAgent.toLowerCase(); var version = 0; //IE浏览器判断版本 if(u.indexOf('trident') > -1){ var v1 = u.match(/(?:msie\s([\w.]+))/); var v2 = u.match(/(?:trident.*rv:([\w.]+))/); if (v1 && v2 && v1[1] && v2[1]) { version = Math.max(v1[1] * 1, v2[1] * 1); } else if (v1 && v1[1]) { version = v1[1] * 1; } else if (v2 && v2[1]) { version = v2[1] * 1; } else { version = 0; } if(version<11){ $("#noSupportDiv").show(); $("#cardQueryForm").hide(); }else{ $("#noSupportDiv").hide(); $("#cardQueryForm").show(); } }else{ $("#noSupportDiv").hide(); $("#cardQueryForm").show(); } $.formValidator.initConfig({ theme : "127", submitOnce : false, errorFocus : false, onError : function(msg, obj, errorlist) { }, ajaxPrompt : '有数据正在异步验证,请稍等...' }); $("#cardNo").formValidator({ onShowFixText : "", onShowText : "", onShow : "", onFocus : "", onCorrect : "", onShowFixText : "请输入您的自助保险卡账号", defaultValue : "" }).inputValidator({ min : 1, max : 50, onError : "请输入您的自助保险卡账号" }); $("#isPassword").formValidator({ onShowFixText : "", onShowText : "", onShow : "", onFocus : "", onCorrect : "", onShowFixText : "请输入自助保险卡密码", defaultValue : "" }).inputValidator({ min : 1, max : 50, onError : "请输入自助保险卡密码" }); $("#j_captcha").formValidator({ onShowFixText : "", onShowText : "", onShow : "", onFocus : "", onCorrect : "", onShowFixText : "请输入验证码", defaultValue : "" }).inputValidator({ min : 1, max : 200, onError : "请输入验证码" }); $("#resetBtn").click(function(e) { e.preventDefault(); $(".onError").css("display","none"); $(".onCorrect").css("display","none"); // 这里使用了插件form的resetForm()函数,恢复到第一次加载页面的状态 $("#cardQueryForm").resetForm(); }); $("#saveBtn").click(function (e) { var j_captcha=$("#j_captcha").val(); if(j_captcha.length != 4){ $("#j_captchaTip").html("请输入正确的验证码"); $("#j_captchaTip").addClass("onError"); $("#j_captchaTip").show(); return; } Newtouch.Ajax.sendParams({j_captcha:$("#j_captcha").val()}, "../../jCaptche_check.check", function(data){ //验证码正确 if(data['_value']=="ok"){ $(".onError").css("display","none"); var formParams = {}; formParams = $("#cardQueryForm").values(); $.blockUI({message: '