我正在尝试使用 jQuery 进行分页。我正在使用 will_paginate gem。它正常工作(没有javascript)。我尝试遵循 railscast ( http://railscasts.com/episodes/174-pagination-with-ajax ) 但我仍然遇到问题。
显示.js.erb
$('#comments').html("<%= escape_javascript(render "comments/comment.html.erb") %>");
这在部分文件只是 html 时有效。IE 没有 <% 这样的代码 %>。为什么?.html 是要调用的错误 jQuery 函数吗?我应该使用什么?
从尝试让事情开始,这段代码可能是问题所在:
$(".pagination a").click(function() {
//$(".pagination").html("Page is loading...");
$.get(this.href, null, null, "script");
return false;
});
什么是“脚本”?