ajax设置同步

$.ajaxSetup({async: false});

$.post('/admin/brand/checkDomainName.action?brand.domainName='+domainNameId.val(),function(data){

if(data=='true'){

checkDomainName=false;

}

});

  $.ajaxSetup({async: true});

var formData = $(formid).serialize(); 

$.ajax({

type:"POST",

url:action,

processData:true,

async:false,

            data : formData,

            dataType:'json',

success:function(data){

}

});

相关推荐