- 커피 스크립트의
@
입니다 단지 this.
에 대한 나타내는 표현이 그래서 원래 JS는이 여기서
당신이 원래의 js에서
$(this)
이 어디 17,451,515,
if (input1.val().length <= 4 ...
당신의 커피 스크립트가
if input1.val() <= 4
이 있어야합니다, 당신은 여전히 당신의 커피 스크립트에 $(this)
이 필요합니다. . 그래서
또는 @의 input1.map (-.> this.val() 일치 (/ \ S +/g)) 길이 없습니다 0
은 다음과 같아야합니다
or @input1.map(-> $(this).val().match(/\s+/g)).length not 0
I 다른 문제를 직접 볼 수는 없습니다. 시도해보고 문제가 발생하는지 또는 오류가 있는지 살펴 봅니다.
[편집]
브라켓에 또한 not 0
에 언급 된 바와 같이 주로 관련된 다른 문제가 있었다.
if input1.val() <= 4 \
or (input1.map(-> $(this).val().match(/\s+/g)).length != 0) \
or (input1.map(-> $(this).val().match(/[^A-Za-z0-9]/g)).length != 0)
then input1.attr('id','error-highlight');
else input1.attr('id','success-highlight');
그것은된다 :
(function() {
if (input1.val() <= 4 || (input1.map(function() {
return $(this).val().match(/\s+/g);
}).length !== 0) || (input1.map(function() {
return $(this).val().match(/[^A-Za-z0-9]/g);
}).length !== 0)) {
input1.attr('id', 'error-highlight');
} else {
input1.attr('id', 'success-highlight');
}
}).call(this);
에 대한 권리 보이는 다음 작업은 (내가 생각하는) 커피 스크립트가 있습니다.
귀하의 내가 입력 1에서 @를 제거하는 경우 하나 :( – Raynos