我假設你哈瓦分頁您的網站指向那些在你產生pagination.phtml文件的不同頁面的鏈接地方。
的OnClick你需要得到href屬性並加載這樣的內容:
function getContents() {
var url = window.location.protocol + "//" +
window.location.host + $(this).attr('href');
var jqxhr = $.post(url, {
"format" : "json"
}, function(data) {
displayContents(data);
}, 'html');
return false;
}
$(document).ready(function() {
$("#paginator a").each(function() {
$(this).click(getContents);
});
});
這樣,你得到你的經典網址
www.mysite.com/?search=something&page=2
也許你需要更改URL字段。只需提醒url字段並查看需要更改的內容。
這裏是一個教程(不含搜索):Zend Framework 1.9 tutorial 14: ajax requests part 1
我們能看出你正在使用的代碼。 Zend Paginator與渲染頁面url沒有任何關係。 – satrun77 2011-04-19 12:44:12