Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$('#' + popButton + '').click(function () {
var tval = $('#' + popTel + '').text();
var add = true;
var reTel = /^1\d{10}$/;
var reg = /^0\d{2,3}-\d{7,8}(-\d{1,6})?$/;
// 判断名字是否为空
if (popContact !== '') {
if ($.trim($('#' + popContact + '').text()) === '') {
$('#' + popContact + '').attr('placeholder', '请输入你的姓名');
$('#' + popContact + '').css('border-color', '#FF0000');
}
else {
$('#' + popContact + ' ').css('border-color', '#d2d2d2');
popContactValue = $.trim($('#' + popContact + ' ').text());
}
}
// 判断联系方式是否为空
if ($.trim(tval) === ' ') {
$('#' + popTel + '').css('border-color', '#FF0000');
$('#' + popTel + '').attr('placeholder', '请输入你的手机号码');
return;
}
else if (reTel.test(tval) === false && reg.test(tval) === false) {
$('#' + popTel + '').css('border-color', '#FF0000');
$('#' + popTel + '').text('');
$('#' + popTel + '').attr('placeholder', '输入的联系方式不正确');
return;
}
else {
$('#' + popTel + '').css('border-color', '#d2d2d2');
var add = true;
var reTel = /^1\d{10}$/;
var reg = /^0\d{2,3}-\d{7,8}(-\d{1,6})?$/;
// 判断名字是否为空
if (popContact !== '') {
if ($.trim(popContactObject.text()) === '') {
// $('#' + popContact + '').attr('placeholder', '请输入你的姓名');
// $('#' + popContact + '').css('border-color', '#FF0000');
popContactObject.attr('placeholder', '请输入你的姓名');
popContactObject.css('border-color', '#FF0000');
alert('请输入你的姓名');
return;
}
else {
popContactObject.css('border-color', '#d2d2d2');
popContactValue = $.trim(popContactObject.text());
}
}
// 判断联系方式是否为空
if ($.trim(tval) === '') {
popTelObject.css('border-color', '#FF0000');
popTelObject.attr('placeholder', '请输入你的手机号码');
alert('请输入你的手机号码');
return;
}
else if (reTel.test(tval) === false && reg.test(tval) === false) {
popTelObject.css('border-color', '#FF0000');
popTelObject.text('');
popTelObject.attr('placeholder', '输入的联系方式不正确');
alert('输入的联系方式不正确');
return;
}
function getOpt(element) {
var $element = $(element);
// 获取元素绑定的广告位id、uid(医生id)和关键词
var posId = $element.attr('fh-ad-pid');
var keywords = $element.attr('fh-ad-keywords') || paramObj;
var lazy = $element.attr('lazy') || 'false';
var uid = $element.attr('fh-ad-uid');
// 广告初始化参数
var opt = {
posId: $.trim(posId),
kw: $.trim(keywords),
lazy: lazy,
uid: $.trim(uid),
element: $element
};
return opt;
}
function getOpt(element) {
var $element = $(element);
// 获取元素绑定的广告位id、uid(医生id)和关键词
var posId = $element.attr('pid');
// 广告初始化参数
var opt = {
posId: $.trim(posId),
kw: paramObj,
element: $element
};
return opt;
}
function getOpt(element) {
var $element = $(element);
// 获取元素绑定的广告位id、uid(医生id)和关键词
var posId = $element.attr('fh-ad-pid');
var keywords = $element.attr('fh-ad-keywords') || paramObj;
var lazy = $element.attr('lazy') || 'false';
var uid = $element.attr('fh-ad-uid');
// 广告初始化参数
var opt = {
posId: $.trim(posId),
kw: $.trim(keywords),
lazy: lazy,
uid: $.trim(uid),
element: $element
};
return opt;
}
var getOpt = function (element) {
var $element = $(element);
// 获取元素绑定的广告位id和关键词
var posId = $element.attr('fh-ad-pid');
var keywords = $element.attr('fh-ad-keywords') || paramObj;
var lazy = $element.attr('lazy');
// 广告初始化参数
// 广告位id数组 [1, 11, 14, 47, 48, 49];
var opt = {
posId: posId,
kw: $.trim(keywords),
lazy: lazy,
element: $element
};
return opt;
};
var menuCtrl = function () {
zxAjax: function (data, ele, url) {
var $this = $(ele);
var mobile = $.trim($(ele).find('.form-input.phone').val());
var area = $.trim($(ele).find('.form-input.area').val()) || '80';
var $city = JSON.parse(storage.get('city'));
var index = $this.find('.item').index($this.find('.item.cur'));
var yusuanPostD = {
areaname: $city['area_cn'],
pro: $city['city_cn'],
area: area,
areaflag: $city['area_py'],
fjnum: '2',
ktnum: '1',
wsjnum: '1',
cfjnum: '1',
ytnum: '1'
};
var applyData = {
city: $city['area_py'],
baojia: '',
$('#tuverify').blur(function() {
var tuyzm = $.trim($('#tuverify').val())
if(tuyzm==''){
$('.tuyzma').show().html('请输入图形验证码');
}
return false;
});
$('#tuverify').focus(function() {
function submitgo() {
var phone = $.trim($el.find('.telphone').val());
var pass = $.trim($el.find('.passText').val());
var code = $.trim($el.find('.input_idf').val());
var remember = '';
if ($el.find('.check').hasClass('checkbox')) {
remember = true;
}
$.ajax({
type: 'POST',
url: ajaxurl,
cache: false,
data: 'account=' + phone + '&password=' + pass + '&code=' + code
+ '&remember=' + remember + '&t=' + Math.random(),
dataType: 'json',
async: false,
success: function (data) {
if (data.status === 1) {
$('.tjbutton').click(function () {
var msg = $.trim($('.comment .text').val());
var csoftid = $('#SOHUCS').attr('sid');
if (msg.length < 3 || msg.lenght > 200) {
alert('评论的内容不能小于3或大于200个字符!');
$('.comment .text').focus();
return false;
}
var imgcode = $.trim($('.yzm').val());
if (imgcode === '') {
alert('请输入验证码!');
$('.yzm').focus();
return false;
}
$.post('/postfrm_ajax.asp', {
comment: (msg),
softid: csoftid,
pImgCode: escape(imgcode),
ctype: 1
},
function (data) {
if (data === 'code') {
alert('验证码错误,请重新输入!');
$('.yzm').focus();
$('.comment mip-img').attr('src', '/getcode.asp?time=' + Math.random());