tags:

views:

45

answers:

0

Hi,

(Following on from my previous questions - earlier queston)

This is the code I've ended up with, although it still doesn't work and is driving me crazy! Any help greatly appreciated. S

  $(document).ready(function(){    

         function initialize() {
            $.ajax({                   
            type: "POST",
            url: "more_press.php",
            data: "lastmsg="+ ID, 
            cache: false,            
            success: function(html){                                        
            $("div#updates").append(html);
            $("#more"+ID).remove();
                    },
            error: function(){
            alert("Computer says no!");    
            }

                });
        }


        //More Button            
        $('.more').live("click",function() 
        {    
        $.cookie('viewing_expanded_content',true, { expires : new Date(new Date().valueOf() + 60 * 60 * 1000) });
        var ID = $(this).attr("id");
        if(ID)
        {                        
        $("#more"+ID).html('<img src="images/more_press.gif" alt="More results..." />');

        initialize();

        } else {
        $(".morebox").html('<p><strong>No more results...</strong></p>');
        }
        return false;
                });

        var viewing_expanded_content = $.cookie('viewing_expanded_content');
        if ( viewing_expanded_content == 'true' ) {

            alert("Active cookies!");

            initialize();                

            }    

        })  

EDIT: Working solution here...