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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:53:30+00:00 2026-05-16T23:53:30+00:00

The website to see the error (click the home, models, etc links) : http://bit.ly/9AE2RI

  • 0

The website to see the error (click the home, models, etc links) : http://bit.ly/9AE2RI

I am trying to get the #content-container of other pages to load into the current pages #content-container. I can do this but what the .load in JQuery seems to do is make it like so:

<div id=content-container style="display:block">
   <div id=content-container>
      OTHER PAGE CONTENT HERE
   </div>
</div>

Therefore when I am using transparent backgrounds like I am on #content-container, then it creates 2 backgrounds, thus messing up the transparency. It also seems to inherit the padding or margin of the #content-container giving it an offset.

Is there not a way to take just the inside of #content-container and load it into the current #content-container; Such as:

<div id=content-container>
      OTHER PAGE CONTENT HERE
</div>

JQUERY code here: (taken from example at http://net.tutsplus.com/tutorials/javascript-ajax/how-to-load-in-and-animate-content-with-jquery/)

$(document).ready(function() {

    var hash = window.location.hash.substr(1);
    var href = $('#sub-navigation li a').each(function(){
        var href = $(this).attr('href');
        if(hash==href.substr(0,href.length-5)){
            var toLoad = hash+'.html #content-container';
            $('#content-container').load(toLoad)
        }                                           
    });

    $('#sub-navigation li a').click(function(){

        var toLoad = $(this).attr('href')+' #content-container';
        $('#content-container').hide('fast',loadContent);


        //$('#load').remove();
        //$('#wrapper').append('<span id="load">LOADING...</span>');
        //$('#load').fadeIn('normal');
        //window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
        function loadContent() {
            $('#content-container').load(toLoad,'',showNewContent())
        }
        function showNewContent() {
            $('#content-container').show('normal',hideLoader());
        }
        function hideLoader() {
            //$('#load').fadeOut('normal');
        }
        return false;

    });

});

Please note the comments are going to be features to come.

  • 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-16T23:53:30+00:00Added an answer on May 16, 2026 at 11:53 pm

    When you set your toLoad variable, add the all children selector so that you don’t get the parent element.

    e.g. –

    var toLoad = $(this).attr('href')+' #content-container > *';
    

    This way, the toLoad var will only have the children of #content-container

    Or if that doesn’t work for you, you can call load on an element not added to the dom yet like this:

    var $div = $("<div/>");
    $div.load(toLoad);
    $("#content-container").html($div.contents());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error on a .click() event in jQuery. I see it in
Some of the 404 error logs I see on my website are obviously caused
Didn't find any from their website. I mostly just trying to see which one
From the Microsoft website (see msdn.microsoft.com/en-us/library/ms683502(VS.85).aspx ) it clearly says Services cannot directly interact
When I see website starter code and examples, the CSS is always in a
I have the following problem. I am making this website you can see in
I'd like to see what a website is sending when I submit a form.
I was wondering how does Nike website make the change you can see when
Visit this website. https://zapier.com/ See this portion of the website. I wan that same
I want to check a particular website from various locations. For example, I see

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.