0
Chrome에서 열려고 할 때마다 HTTPS 오류로 오류가 발생하며 Chrome이 보안을 차단합니다.Javascript를 사용하여 다른 HTML 파일에 HTML 파일을 포함시키는 방법은 무엇입니까?
function w3IncludeHTML() { var z, i, a, file, xhttp; z =
document.getElementsByTagName("*"); for (i = 0; i < z.length; i++)
{
if (z[i].getAttribute("w3-include-html")) {
a = z[i].cloneNode(false);
file = z[i].getAttribute("w3-include-html");
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
a.removeAttribute("w3-include-html");
a.innerHTML = xhttp.responseText;
z[i].parentNode.replaceChild(a, z[i]);
w3IncludeHTML();
}
}
xhttp.open("GET", file, true);
xhttp.send();
return;
}
}
}
대답은 여기에서 찾을 수 있습니다 http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file –
http에서 https로 또는 그 반대로 요청할 수 없음 – charlietfl
친애하는 친구에게 질문을 던지기 전에 질문하지 않았는지 물어 보았습니다. 눈을 뜨고 다시 보게하십시오. –