Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3244524
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:33:41+00:00 2026-05-17T18:33:41+00:00

I’m using the below code in order to increase the number of results that

  • 0

I’m using the below code in order to increase the number of results that my php/mysql pulls-in through a ‘more’ button.

My question is: Can I add a jquery cookie so that when the ‘more’ button is pressed, and more results are loaded, the current state is saved?

The results in question are listed elements which contain links to their respective article. The only problem is that when you view an article from the ‘more’ results, and then go back to the listed results page, the results that were brought in by the ajax (more-press.php) are gone : (

Hence my question. Hope it makes sense. Thanks in advance. S.

$(document).ready(
function(){                                        
        $(function() {
        //More Button
        $('.more').live("click",function() 
        {
        var ID = $(this).attr("id");
        if(ID)
        {
        $("#more"+ID).html('<img src="images/more_press.gif" alt="More results..." />');
        $.ajax({
        type: "POST",
        url: "more_press.php",
        data: "lastmsg="+ ID, 
        cache: false,
        success: function(html){
        $("div#updates").append(html);
        $("#more"+ID).remove();
                }
            });
        } else {
        $(".morebox").html('<p><strong>No more results...</strong></p>');
        }
        return false;
                });
            });
        })

Edit: Also have this related post – Question 2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:33:42+00:00Added an answer on May 17, 2026 at 6:33 pm

    Sure, you can do this. Use the jquery cookie plugin to set a cookie when they click the “more” button and load more results, e.g.:

    // set cookie to expire in 60 minutes when 'more' is clicked
    $.cookie('viewing_expanded_content',true, {
        expires : new Date(new Date().valueOf() + 60 * 60 * 1000)
    });
    

    And when they return to the list of articles, either check for the cookie on the server side and serve the full list initially, or check for the presence of the cookie on the client side using Javascript and fetch the additional content if the cookie’s value is set to ‘true’:

    if($.cookie('viewing_expanded_content')) {
      // make your ajax call, etc
    }
    

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
In order to apply a triggered animation to all ToolTip s in my app,
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Does anyone know how can I replace this 2 symbol below from the string
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.