function follow() {
const followBtn = $('.mypage__follow');
followBtn.click(function () {
$.ajax({
type: 'POST',
url: 'php-scripts/my-pageHandler.php',
dataType: 'html',
data: {
followBtn: followBtn
},
success: function (data) {
alert(data);
}
});
});
}
function follow()
{
if (isset($_POST['followBtn'])) {
echo 'Работает';
}
}