SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    keep showing post result

    This code works and shows the time

    PHP Code:
    <script type="text/javascript">
        
    jQuery(document).ready(function(){
        
    jQuery("#show_more").click(function(){        
            
            var 
    rel jQuery(this).attr("rel");            
            var 
    data = {
                
    action'more',
                
    relrel
            
    };
            
    jQuery("#read_more").html("loading...");
            
    jQuery.post("time.php"data,
            function(
    response){
                
    jQuery('#more').html(response);
            });
            return 
    false;        

            });
        });
    </script>

    <div id="more"></div>

    <a id="show_more" href="" rel="2">show more</a> 
    file time.php
    PHP Code:
    <?php

    echo time().'<br />';

    ?>

    Result is the following if clicking show more link
    ie
    1307461931
    show more

    How can I have keep the previous time and add one to the list, basically would be showing the following?
    1307461931
    1307461940
    1307461972
    show more

    Every time I click show more, it would add a time to the list

  2. #2
    SitePoint Zealot
    Join Date
    Nov 2005
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found it.

    jQuery('#more').append(response);
    instead of
    jQuery('#more').html(response);


    Let me ask you this, if you could and it is possible.

    Imagine the file time.php has a limit
    PHP Code:
    <?php

    echo time().'<br />';

    // if (time() > 1307463951) $not_show_more_link = 1;
    ?>
    Is it possible to hide "show more" link if time.php reports a response to hide it?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •