<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Работа с AJAX в jQuery</title>
<link rel="stylesheet" href="styles.css">
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="scripts.js"></script>
</head>
<body>
<h1>Текущие новости:</h3>
<div id="newsContainer"></div>
<button>Загрузить новости</button>
</body>
</html>
#newsContainer { border: 1px solid #d0d0d0; width: 100%; height: 200px; }
button { width: 180px; height: 30px; border: 1px solid #d0d0d0; background-color: #f0f0f0; color: #000000; outline: none; margin-top: 30px; }
$(window).on('load', function()
{
$('button').click(function()
{
$('#newsContainer').load('scripts.php');
});
});
<?
echo '1) Текст первой новости<br>2) Текст второй новости<br>3) Текст третьей новости';
?>