如题所述
你好,jquery中ajax默认是异步,即async=true。如果要转变成同步,则async=false即可。具体如下操作:
jQuery.ajax({
type: "post",
url: url,
cache: false,
async: false,
contenttype: "text/html;charset=gbk",
success: function(data){
if(data=='1'){
same=true;
}
});
如果满意,望采纳,谢谢!