Способность самостоятельно .load () элемент с другой страницы HTML.
Accueil
HEELLLO
$(document).ready(function () {
function f(responseTxt, statusTxt, xhr){
if(statusTxt == "success")
console.log("External content loaded successfully!");
if(statusTxt == "error")
console.log("Error: " + xhr.status + ": " + xhr.statusText);
}
$("#header").load("header.html", function(responseTxt, statusTxt, xhr){
f(responseTxt, statusTxt, xhr)
});
})
< /code>
Вот мой "header.html": < /p>
Se connecter
document.getElementById("loginButton").onclick = function () {
$("#main").load("logIn.html");
};
< /code>
Я также пытался .load () что -то в разделе «#Main», и это стирает «Heelllo». Он возвращает в журнале «Внешний контент успешно загружен!».
Подробнее здесь: https://stackoverflow.com/questions/797 ... -blank-div