title: ajax 'script' dataType not working?
body: <p>I'm trying to use this function for infinite scroll:</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
  (function() {
    var page = 1,
        loading = false;
  
    function nearBottomOfPage() {
      return $(window).scrollTop() &gt; $(document).height() - $(window).height() - 200;
    }
  
    $(window).scroll(function(){
      if (loading) {
        return;
      }
  
      if(nearBottomOfPage()) {
        loading = true;
        page++;
        $.ajax({
          url: '/paginate?page=' + page,
          type: 'get',
          dataType: 'script',
          success: function(data) {
            $(".res-list").append(data.responseText);
            $(window).sausage('draw');
            loading = false;
          }
        });
      }
    });
  
    $(window).sausage();
  }());
  &lt;/script&gt;
  </code></pre>
  
  <p>The problem is it's not appending the data to the unordered list, even though <code>http://localhost:3000/paginate?format=js&amp;page=2</code> works perfectly.</p>
  
  <p>If I put console.log beneath the line that says: <code>if(nearBottomOfPage()) {</code> it triggers, so i know the function is working fine. Yet if I put the console.log within success:  for the ajax function it never triggers.... and still further, If i run the ajax command through console it returns exactly what I need in the 'responseText', with success code 200... so i have no idea why it would nto be triggering a success message in console log if its successfully returning 200 when i do it manually..</p>
  
  <p>heres the controller</p>
  
  <pre><code>  def paginate
      @resources = Resource.order(:created_at).page(params[:page]).per(20)
  
      respond_to do |format|
        format.js
      end
    end
  </code></pre>