js ajax return false了,仍然会往下执行

 1  function checkMust(){
 2   var flag=false;
 3   $.getJSON("../Ajax/Carton/Ajax_TMSOrder_Create.ashx?r=" + Math.random(), { "action": "GetToWaybill","WAYBILLNO": $("#tbWaybillNo").val(), "FWDCD": $("#ddlForwarder").val() }, function (r) {
 4                     if (r.length > 0) {
 5                        alert("<%= Resources.GlobalResource_Carton.ErMsg91%>");
 6                            flag=true;
 7                     }  
 8             });
 9        if(flag){
10         return false;
11        }
12       return true;  
13      }

 

posted @ 2017-03-02 16:42  Bonnie_W  阅读(800)  评论(0编辑  收藏  举报