Имеется три файла (взято из примера: https://openclassrooms.com/en/courses/3523261-use-javascript-in-your-web-projects/3759261-make-your-first-ajax-request)
ajax-example.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/styles-ajax.css">
<title>Title</title>
</head>
<script>
var myRequest = new XMLHttpRequest();
myRequest.open('GET', 'surprise-ajax.html');
myRequest.onreadystatechange = function () {
if (myRequest.readyState === 4) {
document.getElementById('ajax-content').innerHTML = myRequest.responseText;
}
};
function sendTheAJAX() {
myRequest.send();
document.getElementById('reveal').style.display = 'none';
}
</script>
<body>
<h1>Today's your special day!</h1>
<button id="reveal" onclick="sendTheAJAX()" class="button">Why's that?</button>
<div id="ajax-content">
</div>
</body>
</html>
surprise-ajax.html
<h1 id="birthday-greeting">It's your birthday!</h1>
Ну и style-ajax.css
body {
font-family: Helvetica;
text-align: center;
}
#birthday-greeting {
font-size: 72px;
color: red;
text-transform: uppercase;
}
Страница выводится. Но при нажатии кнопки Why's that?
получаю ошибку 404:
{"timestamp":"2018-12-18T17:29:06.593+0000","status":404,"error":"Not Found","message":"No message available","path":"/surprise-ajax.html"}
Файл surprise-ajax.html разместил во всех папках пректа, но ситуацию не меняет.
Как решить?
Оборудование для ресторана: новинки профессиональной кухонной техники
Частный дом престарелых в Киеве: комфорт, забота и профессиональный уход
Ситуация следующаяЕсть datepicker, который имеет 2 варианта выпадения: над формой и под ней
Накидал страничку приложения на Bootstrap, подключаю DatePicker сначала ругается, что не знает, что такое $Установил jQuery, импортировал