<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
</head>

<body style="height: 3000px">
<script>

onscroll = function(){
  var scrollHeight = Math.max(
    document.body.scrollHeight, document.documentElement.scrollHeight,
    document.body.offsetHeight, document.documentElement.offsetHeight,
    document.body.clientHeight, document.documentElement.clientHeight
  );

  if(window.scrollY >= scrollHeight - innerHeight) alert('Конец прокрутки');
};
  </script>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.