// 当注册账户已存在 $(‘.login-form‘).find(‘.address-email‘).on(‘input‘, function () { var $this = $(this), email = $.trim($this.val()), pattern = /\w+([\-+.‘]\w+)*@\w+([\-.]\w+)*\.\w+([\-.]\w+)*/, ajaxRegisterEmail, recognised = $this.next(‘.recognised‘), submitBtn = $this.parent().siblings(‘.buttons‘).find(‘.btn-submit‘); if (ajaxRegisterEmail !== undefined) { ajaxRegisterEmail.abort(); } if (email !== ‘‘ && pattern.test(email)) { ajaxRegisterEmail = $.ajax({ url: eventure.getUncachedUrl(‘/Base/BaseHandler‘), type: ‘POST‘, data: { pt: ‘check-email-exist‘, email: email }, success: function (data) { if (data.status === ‘f‘) { recognised.show().text(data.message); $this.addClass(‘input-validation-error‘); submitBtn.addClass(‘disabled‘).removeClass(‘btn-red‘).prop(‘disabled‘, true); } else { recognised.hide(); $this.removeClass(‘input-validation-error‘); submitBtn.removeClass(‘disabled‘).addClass(‘btn-red‘).prop(‘disabled‘, false); } } }) } });