title: Using jquery getScript in a rails 3 app
body: <p>So after following a railscast (http://railscasts.com/episodes/240-search-sort-paginate-with-ajax) about loading records through ajax when someone clicks a link, I have the following javascript:</p>
  
  <pre><code>$(function() {
    $("#dash_container th a").live("click", function() {
      $.getScript(this.href);
      return false;
    });
  });
  </code></pre>
  
  <p>This works perfectly. </p>
  
  <p>However, in my template file, I'm trying to work with Pusher to achive something similar:</p>
  
  <pre><code>  var pusher = new Pusher('MYID');
    var channel = pusher.subscribe('newposts');
  
    channel.bind(&lt;%= @push_ch %&gt;, function(data) {
          $.getScript(this.href);
          return false;
    });
  </code></pre>
  
  <p>This used to work just fine - but I think I've included a javascript file that has broken it... When the pusher channel is now supposed to reload the set of records, I get the following type of error in my browser log:</p>
  
  <p>GET Undefined?_ 1312905840215 404</p>
  
  <p>clearly, its looking for something thats not there, rather than refreshing the records. This makes me think I'm improperly using the (this.href) call, as its trying to load something else. </p>
  
  <p>Also, I have the following in my index.js.erb - which is what should be refreshed:</p>
  
  <pre><code>$("#dash_container").html("&lt;%= escape_javascript(render("dashboard")) %&gt;");
  </code></pre>
  
  <p>Any ideas?</p>