나는 다음과 같은 코드가 있습니다 오류 : 구문 오류, 인식 할 수없는 표현 : #의 JQuery와
$('.questionAlternative').change(function() {
var nestedQuestion = $(this).attr('nestedQuestion');
if(nestedQuestion != null || nestedQuestion != "") {
$("#"+nestedQuestion).show();
} else {
$(this).parent().next('.nestedQuestionContainer').hide();
}
}
.questionAlternative
은 예 또는 아니오, 두 개의 라디오 버튼입니다.내가 아니요로 변경
, 나는 다음과 같은 오류가 발생합니다 :Error: Syntax error, unrecognized expression: #
throw new Error("Syntax error, unrecognized expression: " + msg);
나는 이유를 이해할 수 없다. nestedQuestion이 비어 있으면 If 문으로 들어갈 수 없습니다. 하지만 어쨌든 그것을하고있는 것처럼 보입니다.
"" "! = null"은 'true'입니다. – Andreas