function testConnect(){


    var ftpUrl=trimString($("uploadJavaAppUrl").value);
    var sURL="./testftp.jsp?urlPrefix="+ftpUrl;


    new Ajax.Request(sURL,{  
            method: 'post',   
            onSuccess: function(transport) {                      
                 eval("var obj="+transport.responseText);
                 try{
                     $('uploadFMSAppUrl').value=obj["fma.uploadFMSUrl"];
                     $('playftp').innerText =obj["fma.uploadFMSUrl"];



                     $('recordFMSAppUrl').value=obj["fma.recordFMSUrl"];
                     $('reocordftp').innerText =obj["fma.recordFMSUrl"];


                     $('thumbsHomeUrl').value=obj["fma.publicThumbHomeUrl"];
                     $('imageftp').innerText =obj["fma.publicThumbHomeUrl"];

                     $('frmData').submit();
                 }catch(error){    
                     CTRSAction_alert(“无效地址");
                     setTimeout(function(){
                         $("uploadJavaAppUrl").focus();
                     },10);
                        return false;
                

                 }
           },          
           onFailure:function(transport)  {  
              CTRSAction_alert("无效地址");
             setTimeout(function(){
                         $("uploadJavaAppUrl").focus();
                     },10);
                       return false;
             
           }
        }
    )
    
}


上面代码中,两处红色的地方其实是无效的,如果写个函数function (){

   return  testConect();
}
发现return undifened,这是因为其实异步请求中,testConect已经执行完毕,所以return false已经失效