Приветствую. Делал все по руководству, но оно, видимо, устарело за несколько лет. Просьба указать на ошибку, подправить. Спасибо.
p.s. почему-то и кодировка не отображается русская.
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<title>Ajax</title>
</head>
<body>
<p id="load" style="cursor:pointer">Load datings</p>
<div id="information"></div>
<script>
function funcBefore(){
$("#information").text("Waiting dates")
}
function funcSuccess(){
$("#information").text(data)
}
$(document).ready(function(){
$("#load").bind("click",function(){
var admin = "Admin"
$.ajax ({
url:"content.php",
type:"POST",
data:({name:admin,number:5}),
dataType:"html",
beforeSend:funcBefore,
success:funcSuccess
});
});
})
</script>
</body>
</html>
<?php
sleep(2);
echo "You wrote the next information, from autor - $_POST[name] and with number- $_POST[number]";
?>