我面临一些问题与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