그래서 나는 자바 스크립트 배열을 가지고 배열에 나는이있다 : 배열의 설명 부분 집합에인쇄 자바 스크립트 배열 값은 제대로
var quiz = [{
"question": "What is the greatest common factor of 105 and 126?",
"image": "",
"choices": ["3", "7",
"9", "21", "35"
],
"correct": "21",
"conceptlink": "https://www.khanacademy.org/math/in-sixth-grade-math/playing-numbers/highest-common-factor/v/greatest-common-divisor",
"explanation": "In order to solve this question, you must factor each number into prime factors<h1>Height</h1>",
}];
초점을. 인쇄 할 H1 요소가 있지만 대신 코드 대신 텍스트의 일부로 인쇄됩니다. 즉, 텍스트는 다음과 같습니다
전문가 기꺼이 할 것이다 JS에서 설명을
$('#explanation').html('<strong>Incorrect.</strong> ' + htmlEncode(quiz[currentquestion]['explanation']));
어떤 도움을 출력 코드의 고맙다 !!
'htmlEncode()'가 올바르게 작동하는 것 같습니다. :) – Andreas
불행히도. 나는 그것을 여러 번 시험했다. : ( –