title: To Check "user has scrolled to the bottom code" is not working on chrome but it works on Microsoft Edge. WHY?
body: <p>I use this code to check whether user has scrolled to the bottom code or not but it don't work on Google Chrome but it successfully works on Microsoft Edge.</p>
  
  <p>In Google Chrome when i scroll to bottom and again scroll to top then it works but I don't know why.</p>
  
  <p>Here is the code i am using.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
  
   $(window).scroll(function() {   
     if($(window).scrollTop() + $(window).height() == $(document).height()) {
         alert("bottom!");
     }
  });
  &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!decotype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
      
    &lt;/head&gt;
     &lt;body&gt;
         
         
   &lt;div style="height: 4000px"&gt;Scroll down!&lt;/div&gt;
  &lt;/body&gt; 
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>