jQuery 코드가 있는데, 문서에 없으면 유효성 검사가 잘 통과되지만 오류가 발생합니다. 문제의 코드는 여기에 있습니다 :jQuery 코드에서 W3 xHTML 유효성 검사 오류!
$.ajax({
type: "GET",
url: "data.xml",
dataType: "xml",
success: function(xml) {
//Update error info
errors = $(xml).find("Errors").find("*").filter(function()
{
return $(this).children().length === 0;
});
if (errors.length == 0)
{
statuscontent = "<img src='/web/resources/graphics/accept.png' alt='' /> System OK";
}
else
{
statuscontent = "<img src='/web/resources/graphics/exclamation.png' alt='' /> "+errors.length+" System error"+(errors.length>1?"s":"");
}
$("#top-bar-systemstatus a").html(statuscontent);
//Update timestamp
$("#top-bar-timestamp").html($(xml).find("Timestamp").text());
//Update storename
$("#top-bar-storename").html("Store: "+$(xml).find("StoreName").text());
}
});
그래서 나는 확실히이 무엇이 잘못되었는지를 이해할 수 없다 모두가 잘 작동과 오류가 발생하지 않습니다 페이지의 다른 jQuery 코드의 부하가 있습니다. 이 페이지는 "라이브"가 아니므로 불행히도 링크를 제공 할 수 없습니다.
가 나열 오류는 여기
문서 유형은 요소 여기에 "IMG"
그리고 그것을 가리키는 코드 줄을 허용하지 않습니다이다 :
statuscontent = "<img src='/web/resources/graphics/accept.png' alt='' /> System OK";
이 statuscontent
에 대한 문제가 있습니다.
외부에 JavaScript 코드를 만드십시오. – Gumbo
귀하의 hoster가 요청 제한으로 귀하를 처벌하지 않는 한 @Gumbo는 동의합니다. –