jQuery('.ssp_input').keyup(function(){//keyup() var num = jQuery(this).val().length; //alert(num); if(num == 11){ var phone = $('#ssp_phone').val(); alert(phone); $.ajax({ type: "POST", url: '{php echo $this->createMobileUrl("judgephone");}', data: {phone:phone,type:1},//1表示话费 dataType: "json", success: function(data){ console .log(data);
alert(data); $('#resText').empty(); //清空resText里面的所有内容 $('#resText').text(data.area); var html = ''; if(data.valuelist.length!=0){
$('.chongzhi').prop('disabled', false);
$('.ssp_price').show();
$('.ssp_note').hide();
}else{
$('.chongzhi').prop('disabled', true);
$('.ssp_price').hide();
$('.ssp_note').show();
}
$.each(data.valuelist, function(commentIndex, comment){
console.log(commentIndex);//看到网页输出的内容 }); $('#PriceList').html(html); } }); }})
alert(data); $('#resText').empty(); //清空resText里面的所有内容 $('#resText').text(data.area); var html = ''; if(data.valuelist.length!=0){
$('.chongzhi').prop('disabled', false);
$('.ssp_price').show();
$('.ssp_note').hide();
}else{
$('.chongzhi').prop('disabled', true);
$('.ssp_price').hide();
$('.ssp_note').show();
}
$.each(data.valuelist, function(commentIndex, comment){
console.log(commentIndex);//看到网页输出的内容 }); $('#PriceList').html(html); } }); }})
alert(data);
这里没有弹窗,也没有控制台输出