<form action="xxx" method="post" onsubmit="return check__()">function check__(){
var uid = $('#uid').val();
var pwd = $('#pwd').val();
var ys = false;
$.getJSON('xxx', xxx,function(req){
if( req.success !=1 )
{
//显示错误
}
else
{
ys = true;
//这里alert(ys)查看 为 true
} });
return ys;
}我的疑问是,就算返回为true 表单还是不提交,求解!!!!!
var uid = $('#uid').val();
var pwd = $('#pwd').val();
var ys = false;
$.ajax({ url: 'xxx', data: 'xxx', type: 'GET',cache:false
,async:false///////////同步
, success: function () {
if (req.success != 1) {
//显示错误
}
else {
ys = true;
//这里alert(ys)查看 为 true
}
} });
/*$.getJSON('xxx', xxx, function (req) {
if (req.success != 1) {
//显示错误
}
else {
ys = true;
//这里alert(ys)查看 为 true
} });*/
return ys;
}