使用ajax php加载帖子时显示“不再发布帖子”

编程入门 行业动态 更新时间:2024-10-09 20:22:35
本文介绍了使用ajax php加载帖子时显示“不再发布帖子”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

下面是javascript部分并加载更多按钮我正在使用它从数据库加载更多帖子它工作正常我想在所有帖子加载但不知道如何做的时候显示'没有更多帖子'的消息究竟。希望你们能提供帮助。

Below is the javascript part and load more button which I am using to load more posts from database it works fine I want to show a 'no more posts' message when all posts have been loaded but do not know how to do that exactly. Hope you guys can help.

<script type="text/javascript"> $(document).ready(function(){ $(document).on('click','.show_more',function(){ var ID = $(this).attr('id'); $('.show_more').hide(); $('.loding').show(); $.ajax({ type:'POST', url:'mload_more.php', data:'id='+ID, success:function(html){ $('#show_more_main'+ID).remove(); $('.posts').append(html); } }); }); }); </script>

<div class="show_more_main" id="show_more_main<?php echo $ID; ?>"> <span id="<?php echo $ID; ?>" class="show_more" title="Load more posts">Show more</span> <span class="loding" style="display: none;"><span class="loding_txt">Loading...</span></span> </div> </div>

推荐答案

( document )。ready( function (){ (document).ready(function(){

( document )。on(' 点击',' 。show_more', function (){ VAR ID = (document).on('click','.show_more',function(){ var ID =

( this )。attr(' id'); (this).attr('id');

更多推荐

使用ajax php加载帖子时显示“不再发布帖子”

本文发布于:2023-10-10 18:36:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1479394.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:帖子   加载   ajax   php

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!