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 7248883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:12:06+00:00 2026-05-28T22:12:06+00:00

I have a website with these menus <li><a href=#>Man</a> <ul class=sub_menu> <li><a href=mcaps>Caps</a></li> <li><a

  • 0

I have a website with these menus

<li><a href="#">Man</a>
    <ul class="sub_menu">
        <li><a href="mcaps">Caps</a></li>
        <li><a href="#">Shirts</a></li>
        <li><a href="#">Tshirts</a></li>
        <li><a href="#">Jackets</a></li>
        <li><a href="#">Jeans</a></li>
        <li><a href="#">Shorts</a></li>
        <li><a href="#">Footwear</a></li>
    </ul>
</li>

<li><a href="#">Woman</a>
    <ul class="sub_menu">
        <li><a href="#">Caps</a></li>
        <li><a href="#">Sunglasses</a></li>
        <li><a href="#">Shirts</a></li>
        <li><a href="#">Tshirts</a></li>
        <li><a href="#">Dresses</a></li>
        <li><a href="#">Jackets</a></li>
        <li><a href="#">Jeans</a></li>
        <li><a href="#">Purse</a></li>
        <li><a href="#">Handbags</a></li>
        <li><a href="#">Footwear</a></li>
    </ul>
</li>

Now with my jQuery code I’m getting the images and say if a user clicks man > mcaps

$(document).ready(function() {
    $('ul.sub_menu a').click(function(e) {
        e.preventDefault();
        var txt = $(this).attr('href');
        $.ajax({
            type: "POST",
            url: "thegamer.php",
            data:{ send_txt: txt },
            success: function(data){
                $('#container').fadeOut('8000', function (){
                    $('#container').html(data);
                    $('#container').fadeIn('8000');
                });
            }   
        });
    });
}); 

Now when I refresh the page, it goes all out and the index page is displayed, I know I have to work with cookies, but how do I use them to maintain the page?

When a user clicks Woman > jeans now that cookie must be set and not vanish on page refresh.

Any detailed code would be useful.

  • 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-28T22:12:06+00:00Added an answer on May 28, 2026 at 10:12 pm

    First of all you’ll need to download this plugin and add it to your page.

    Then modify your code like this:

    $(document).ready(function() {
        // set the content on page load to match the last clicked link
        setContainerHtml($.cookie("activeElementHref"));
    
       // set the content on link click
        $('ul.sub_menu a').click(function(e) {
            e.preventDefault();
            var txt = $(this).attr('href');
            $.cookie("activeElementHref", txt) 
            setContainerHtml(txt);
        });
    }); 
    
    function setContainerHtml(href) {
        $.ajax({
            type: "POST",
            url: "thegamer.php",
            data:{ send_txt: href },
            success: function(data){
                $('#container').fadeOut('8000', function (){
                    $('#container').html(data);
                    $('#container').fadeIn('8000');
                });
            }   
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website that contains company profiles. These profiles have many pages within
I have updated my website. Previously there were links like these: http://example.com/bla-bla-bla?language=de . After
i have 2 file js in my asp website named 1-jquery.datepick.js 2-jquery.hijridatepick.js these file
My django based website will have 3 seperate menus. The items of first one
I have got a list of menus up on our website with the current
I have the following html: <!-- MainMenu --> <ul class=main-menu> <li><a href=About/xxxxx>About</a></li> <li><a href=Services/xxxxx>Services</a></li>
I am developing a mobile website for android and I have multi level menus.
I have a website running in Microsoft SharePoint which uses menus and other data
I have a website that consists of index.php and otherpage.php. Both of these pages
I have 2 websites of ecommerce in France and for these websites I have

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.