1、一定要把 window 放在外面
2、一定要用同步请求
var result=""; jQuery.ajax({ "type":"post","url":"http://www.baidu.com","async":"false","success":function(rel){ if(rel.isSuccess){ result=rel.url; //window.open(rel.url,"_blank"); } } }); if(result.length>0){ window.open(result,"_blank"); }