2015-01-16 3 views
0

모든 것이 완벽하게 작동하지만 IE에서는 작동하지 않습니다. 이 비동기 호출이 발생하고 콜백 (false)이 실행되었지만 constCentreNumber는 여전히 유효하며 오류는 표시되지 않습니다.녹아웃 비동기 유효성 검사 IE9

self.costCentreNumber = ko.observable().extend({ 
      required: { params: true, message: utils.message.required("Cost Centre number") }, 
      pattern: { 
       message: utils.message.format("Cost Centre number"), 
       params: '^[0-9a-zA-Z]{1,10}$' 
      }, 
      validation: { 
       async: true, 
       message: utils.message.invalid("Cost Centre number"), 
       validator: function (val, otherval, callback) { 
        dataSource.validate.costCode(val, self.shiftStart()) 
         .always(function(result) { 
          callback(result); 
         }); 
       } 
      } 
     }); 

답변

0

아주 바보, 크롬은 부울 결과를 읽지 만 IE - 문자열로, 그것이 여전히 존재 "거짓"

솔루션은 유효한 이유 :

callback(result == "true" || result === true); 
관련 문제