我想分頁使用jQuery。我正在使用will_paginate寶石。它正常工作(沒有JavaScript)。我嘗試了一個railscast(http://railscasts.com/episodes/174-pagination-with-ajax),但我仍然有問題。如果存在RoR代碼,jQuery調用partial將無法工作?
show.js.erb
$('#comments').html("<%= escape_javascript(render "comments/comment.html.erb") %>");
這工作時,部分文件僅僅是HTML。 IE no <%code like this%>。爲什麼? .html是錯誤的jQuery函數嗎?我應該使用什麼?
從艱難讓事情,這段代碼可能是問題:
$(".pagination a").click(function() {
//$(".pagination").html("Page is loading...");
$.get(this.href, null, null, "script");
return false;
});
什麼是「劇本」?
也呈現@comments使重複,而渲染評論/評論不。 – 2010-10-15 15:49:29