我面臨一些問題與jquery標籤內分頁。我已經使用Ajax分頁,因爲它工作良好,但不幸的是,當我第二次點擊任何頁面(分頁)第二次。然後它中斷鏈接 。 請看正視它是如何工作: http://kelts.wpengine.com/7664-top-o-the-morning-312/ 打開最近相關posts->單擊分頁的任何頁面上Ajax分頁裏面的jquery標籤
請確保我使用WP-分頁();.
<script type="text/javascript">
jQuery(".larger.page").live("click", function(e) {
e.preventDefault();
var href = jQuery(this).attr("href");
show_posts(href.replace(/.*page\//, ""));
});
show_posts(1);
});
function show_posts(l) {
jQuery.get("<?php bloginfo('template_directory')?>/fetch-blog-post.php", {
pageno : l
}, function(data) {
jQuery("#show_posts").html(data).show();
});
}
</script>
這裏是我的代碼這裏是我的代碼: <腳本類型= 「文/ JavaScript的」> jQuery的(文件)。就緒(函數(){jQuery的(」 larger.page。 「)生活(」 點擊。 「,function(e){e.preventDefault(); var href = jQuery(this).attr(」href「); show_posts(href.replace(/.* page \ //,」「));}); (1); \t \t}); jQuery.get(「#?php bloginfo('template_directory')?>/fetch-blog-post.php」,{pageno:l},function(data){ jQuery(「 show_posts「)。html(data).show(); }); } – sudhanshu 2013-02-26 12:55:11
編輯你的問題,這是不可讀的。 – AmazingDreams 2013-02-26 12:57:28
有語法錯誤,'});'show_posts(1);'無效後'' – 2013-02-26 12:58:37