Код: Выделить всё
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);
});
});
Код: Выделить всё
Se connecter
document.getElementById("loginButton").onclick = function () {
$("#main").load("logIn.html");
};
Код: Выделить всё
const http = require("http");
const fs = require('fs');
const host = "localhost";
const port = 8060;
const server = http.createServer((req, res) => {
if (req.method === "GET") {
if (req.url == '/' || req.url == '/homepage.html') {
fs.readFile("homepage.html", function (error, content) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(content)
})
} else if (req.url == "/jquery.js") {
fs.readFile("jquery.js", function (error, content) {
res.writeHead(200, {'Content-Type': 'application/javascript'});
res.end(content)
});
}
}
});
server.listen(port, host, () => {
console.log(`Server running at http://${host}:${port}/`);
console.log(`Displaying content of homepage.html`);
});
также увидел этот ответ здесь и не отвечает на мою проблему.>
Подробнее здесь: https://stackoverflow.com/questions/797 ... s-expected
Мобильная версия