我现在正在使用jQuery,现在当我执行$ .get();请求它不起作用,我试图调试,但我没有得到任何消息。我也没有在控制台中出错。
jQuery的:
$('.loginForm').hide( 'slide', {direction:'right'}, 1000);
console.log('Starting...');
$.get('./login.php?user' + value1 + '&pass=' + value2, function(data) {
console.log('try =>' + data);
if(data.status == 'ok') {
$.get('./userdata.php', function(data) {
console.log('userdata =>' + data);
if(typeof data.message == 'string') {
$('.form-control.password').css('border', '2px solid #a94442');
$('.form-control.password').css('-webkit-box-shadow', 'inset 0 1px 1px rgba(0,0,0,0.075)');
$('.form-control.password').css('box-shadow', 'inset 0 1px 1px rgba(0,0,0,0.075)');
$('.loginForm').show('slide', {direction: 'right'}, 1000);
} else {
$('.loginForm').html('hi');
$('.loginForm').show('slide', {direction: 'right'}, 1000);
}
});
} else {
$('.form-control.password').css('border', '2px solid #a94442');
$('.form-control.password').css('-webkit-box-shadow', 'inset 0 1px 1px rgba(0,0,0,0.075)');
$('.form-control.password').css('box-shadow', 'inset 0 1px 1px rgba(0,0,0,0.075)');
$('.loginForm').show('slide', {direction: 'right'}, 1000);
}
});
console.log('Done!');
当我运行此脚本时,控制台会显示“正在开始......”和“完成!”但没有关于console.log的信息('try =>'+ data);或console.log('userdata =>'+ data);
为什么呢?如何解决这个问题?