我刚为我的电子邮件检查程序编写了一些JavaScript。单击按钮时将检查textarea
的每一行,但当我将邮件列表放在textarea
中时,它不起作用。
单击该按钮时,它会将邮件列表的每一行发送到sys_api.php?email=
,但没有PHP错误。
有人可以帮助我吗?
function sys_brain(list, mlist) {
list = $('#mailist').val();
list = list.split('\n');
var _0x7147x6 = 0;
ajaxCall = $.ajax ({
type:"Get",
email: mlist,
url: "sys_api.php?email=" + mlist,
async: true,
beforeSend: function(sys_loading) {
$('#proc-send').css('display', 'block');
$('#proc-done').css('display', 'none');
$('#result-container').css({
display: 'flex'
});
$('#ygdicek').html('Checking <span id=counter>' + list.length + '</span> mailist');
$('#mailist').attr('disabled', true);
$('#mailist').css({
opacity: '0.5'
});
},
success: function(sys_loading) {
},
error: function(sys_loading) {
var _output = document.getElementById('unknown_res');
_output.innerHTML = _output.innerHTML + "span class=unk_reslt" + mlist + "<br></span>";
},
complete: function(sys_loading) {
var hasil = sys_loading.responseJSON;
console.log(hasil);
if (hasil.status == 'live') {
var result = "[" + hasil.country + "] " + hasil.email;
var _output = document.getElementById('live_res');
_output.innerHTML = _output.innerHTML + "<span class=live_reslt>" + result + "<br></span>";
}
else {
if (hasil.status == 'limited') {
var result = "[" + hasil.country + "] " + hasil.email;
var _output = document.getElementById('limited_res');
_output.innerHTML = _output.innerHTML + "<span class=lim_reslt>" + result + "<br></span>";
}
else {
if (hasil.status == 'unknown') {
var _output = document.getElementById(unknown_res);
_output.innerHTML = _output.innerHTML + "<span class=unk_reslt>" + hasil.email + "(" + hasil.msg + ")</span><br>";
}
else {
if (hasil.status == 'invalid') {
var result = hasil.email;
var _output = document.getElementById('invalid_res');
_output.innerHTML = _output.innerHTML + "<span class=inv_reslt>" + result + "<br></span>";
}
}
}
};
setTimeout(function(){
$('#result-container').css({
backround: 'none'
});
}, 300);
var live = $('.live_reslt').length;
var limited = $('.lim_reslt').length;
var unknown = $('.unk_reslt').length;
var invalid = $('.inv_reslt').length;
$('#berapaLive').html(live);
$('#berapaLimited').html(limited);
$('#berapaUnknown').html(unknown);
$('#berapaInvalid').html(invalid);
var berapa = list.length--;
$('#counter').html(berapa);
}
});
}
$(document).ready(function(){
$('#submit').click(function(){
if($('#mailist').val().trim()==''){
alert('No mailist found!');
sys_brain(list, mlist);
}
});
});