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

  • SEARCH
  • Home
  • 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 6133813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:16:35+00:00 2026-05-23T17:16:35+00:00

I am new to JQuery and need som direction. I have created a page

  • 0

I am new to JQuery and need som direction.

I have created a page with a few buttons. When I click one of the buttons, new content is loaded and put in one div. The buttons stays visible at all time.

When I click the other button, some other content is loaded from the server and put in the same div after I have emptied it.

In one of the button’s content I have a “slideshow”. When I switched between the contents a few times the animation gets corrupted. I think the problem I’m having is that I reload the content each time and adds it again to the same div. This isn’t a good way anyway, I should reuse the content in some way.

My question(s) is:

  1. how do I load content from a server and store it in some way in the client
  2. check if the content is loaded already
  3. reuse the content next time it should be shown instead of loading it from the server once again
  4. not overlapping the content in any way

My scripts:

 $(document).ready(function() {
            $("#section2").load("main_mid.php"); 
              $("#taylor_made").click(function () {
                $("#section2").empty();
                $("#section2").load("taylor_made.php"); 
                });

            $("#sm_tool").click(function () {
                $("#section2").empty();
                $("#section2").load("main_mid.php"); 
                });
         });

My buttons:

 <div class="buttons_menu">
        <button id="sm_tool" class="big_buttons" type="button"><img src="sm_tool_button.png" alt="Angry face" /></button>
        <button id="taylor_made" class="big_buttons" type="button"><img src="taylor_made_button.png" alt="Angry face" /></button>
  </div>

The area the content is added to:

<div id="section2">

</div>

In my example above, I simplified the world a bit. In pratice, there will be a few (10-15) buttons with different content associated. It may be a bit much to load all at once. I’m updating my question. It’s actually a normal web page where the menu is built up with buttons and links.

Also to be noted, some of the pages contains images and some have some kind of dynamic content (e.g. the slide shows loads and starts the animation with scripts when the content has been loaded).

Thank’s in advance!

  • 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-23T17:16:35+00:00Added an answer on May 23, 2026 at 5:16 pm

    Either use query’s data api. http://api.jquery.com/jQuery.data/ or load the content into 2 separate divs and toggle them with .hide() .show()

    var price_page = null; 
    $("#prices").click(function () {
        if(price_page==null){
            $("#section2").load("prices.php", function(data) {
                price_page = data;
                $("#section2").removeAttr("class").addClass("price_mid_area");
            }); 
        }else{
            $("#section2").html(price_page).removeAttr("class").addClass("price_mid_area");
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im new to jQuery and need a litte help. I have created a nav
I am new to Jquery and need some help: I have a div, I
I have application that brings response via Ajax and creates 5-20 new jQuery click
I have a document which uses old jQuery and I need new jQuery for
I'm new to jquery and I have a page with multiple unordered lists ul.
I am quite new to Jquery and need help trying to get a few
I am new to jquery. I need help moving content. I am using the
Actually I am new to jquery as well as web designing Now I need
First of all I need to say that I'm new to jQuery. When I
I'm new to Rails and I know a bit of Jquery. I need a

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.