title: Change coffeescript to normal javascript
body: <p>I'm very beginner in javascript and right now im learning from railscast. I have problem how to write this script, writen in coffee script to normal JS. Can somebody do this:</p>
  
  <pre><code>jQuery -&gt;
    if $('.pagination').length
      $(window).scroll -&gt;
        url = $('.pagination .next_page').attr('href')
        if url &amp;&amp; $(window).scrollTop() &gt; $(document).height() - $(window).height() - 50
          $('.pagination').text("Fetching more products...")
          $.getScript(url)
     $(window).scroll()
  
    $('.tooltip').tooltipster(
      animation: 'grow'
  
      );
  </code></pre>
  
  <p>I try with " jQuery(function($) { " but it doesnt work.</p>