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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:36:39+00:00 2026-06-03T00:36:39+00:00

I have a page set-up, with several divs. For now all we need is

  • 0

I have a page set-up, with several divs.
For now all we need is

<div id="main">...</div> & <div id="sidebar">...</div>

Each div has code such as:

<?php include("page.php") ?>

The main div does all the work, and includes a JavaScript function. E.g. at the moment the user can click a button to remember an item displayed in a table.

Am I able to only reload the sidebar instead of the whole page when the user calls this function?
I am posting the function here, and all I need now is to be able to refresh the sidepanel and its included php files if that is possible? I assume something along the lines of this could do the job? or am I wrong? load("#sidebar")

function saveToFavorites(code)
{

    $.ajax({
        async:false,
        type: "POST",
        url: 'formPostsUser.php?reqtype=addToFavorite',
        data:'coursecode='+ code,
        success: function(data) 
        {
            $('.result').html(data);
            if(data != "")
            {
                alert(data);
                load("#sidebar") 
            }
        }
    });
}

Kind regards
Alex

Happy about any and every reply and hint 😉

  • 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-06-03T00:36:40+00:00Added an answer on June 3, 2026 at 12:36 am

    First thing

     <div="sidebar">..</div> 
    

    The above markup is wrong HTML. You should give the sidebar as the value of your properties such as id or class

    <div id="sidebar">..</div> 
    

    Loading the Sidebar content

    You can use jQuery ajax to load content of this div using jQuery load method like this

    $(function(){
      $("#sidebar").load("yourPHPPageToReturnSideBarContent.php");  
    });
    

    Assuming yourPHPPageToReturnSideBarContent.php is the PHP page which renders the HTML Markkup for the sidebar. Note that this will load the content on the document ready event.

    Loading the side bar content on an event

    If you want to load it on a purticular event like a button click you can do it like this

    $(function(){
      $(document).on("click","yourButtonId",function(){
         $("#sidebar").load("yourPHPPageToReturnSideBarContent.php");  
       });
    });
    

    The above script will load the side bar content on a button click. The button’s id is e “yourButtonId” in this example.

    Note that i used jQuery on here to bind the function because it will take care of current element and future element in case if you want to load the markup which contains the button dynamically.

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

Sidebar

Related Questions

I have a master page which has several ContentPlaceHolders. Not all of them are
My page has several items (divs) that are draggable and resizable. My code for
I have a page with some HTML in it. and I need to set
I have the following index.html page set-up: <html> <head> </head> <body> <div id=container> <div
I have a page with a container div that holds three additional divs as
I have a page that has to render a huge set of query results
I have a app set up and on my hoe page/screen several links. When
I have several HTML blocks on a page set up like: <p class=something> <a
I have a login page that has several textboxes on the page, one of
I have a page set up to show only posts from one category, which

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.