解决办法
对于$.ajax():
$.ajax({ async:false });
对于$.get或$.post
$.ajaxSettings.async = false; $.get(url,{param:"param"},function(data){}); $.post(url,{param:"param"},function(data){}); $.ajaxSettings.async = true;