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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:04:33+00:00 2026-06-18T18:04:33+00:00

I would like to load some content via Ajax direcly into a target container.

  • 0

I would like to load some content via Ajax direcly into a target container.

var theData = $('<div id="tempcontainer">').load('/'+targetProject + ' #containerUID' + targetProject);                 
$( theData ).prependTo( '#targetContainer' );

This loads the data into my #targetContainer, but leaves me with an unnecessary #tempcontainer.
Since i want to load multiple items into my #targetContainer i can’t have duplicate #tempcontainers.

What i would like to achieve is to insert the loaded data hidden into my #targetContainer without having duplicate #tempcontainers (avoid it completely would be even better), measure it’s height (whilst hidden if possible), call some functions and fadeIn when the content has loaded.

Thanks in advance!

Greetings,
Knal.

  • 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-18T18:04:34+00:00Added an answer on June 18, 2026 at 6:04 pm

    load() is just a handy shortcut for $.get, so if storing the data in a variable, $.get is probably more appropriate. Then just hide the content, prepend it and fade it in. I do it in a different order to avoid some issues, but that does’nt matter :

    $.get('/'+targetProject , function(data) {
        $( data ).find('#containerUID' + targetProject)
                 .hide()
                 .fadeIn()
                 .prependTo( '#targetContainer' );
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to load some content using AJAX and Shadowbox Basically I would
I would like to load some data stored in a file into my mysql
I have a jQuery ajax function that loads some content into a div, some
I would like to transfer some content from (div class=StaffBlock) that loaded from the
Originally I would like to transfer some content (div class=StaffBlock) which is loaded from
I have some tabs that I load the content up via ajax. I am
I would like to load the content of a file into a string. This
I have a base page that then loads content via .load() into a container
I'm successfully using assets pipeline for months. Now I would like to load some
I have requirement where some times I would like to load children as well

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.