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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:14:44+00:00 2026-05-12T23:14:44+00:00

I get dynamic content with Ajax and i put it in a div, but

  • 0

I get dynamic content with Ajax and i put it in a div, but the problem is that i have diffrent ids for some child divs(from the dynamic content). So i have added selectors for these divs, but as i said they are dynamic loaded and that means they are not visible anywhere before they are loaded(from another file) and inserted into the div. The problem comes when i insert the dynamic content. jQuery can’t select these divs 🙁 Is there any possible solution for my problem?

Hmm maybe my explanation is not good so i will speak with code 😀

Example:
This is the empty div
<div id="div"></div>

Here is the jQuery code

$(document).ready(function(){
$.get("file.php", function(data){
$("#div").html(data);


$("#somediiv").click(function(){
alert("Yeah");
});

$("#somediv").click(function(){
$.get("otherfile.php", function(data){
$("#div").html(data);
});
});

$("#somediv2").click(function(){
$.get("file.php", function(data){
$("#div").html(data);
});
});

});
});

Everything works until the new content comes. In the new content when the “file.php” is loaded there is a div with id “somediiv” and when i click on it “otherfile.php” is going to be loaded and in the content of this div there is another div with id “somediiv”, but when jQuery can’t catch the click 🙁

  • 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-12T23:14:44+00:00Added an answer on May 12, 2026 at 11:14 pm

    I think you have to use live(). Or attach the event in the callback of $.get().

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

Sidebar

Related Questions

Have you noticed that by using jquery's slideDown(), even on elements with dynamic content,
It looks like if I load dynamic content using $.get() , the result is
I'm trying to get a dynamic movie clip from the timeline. I have a
I have an ajax form that I would like to submit, and the response
I'm loading AJAX content that contains a javascript function inside the AJAX content. I'm
In C#4.0 we're going to get dynamic types, or objects whose static type is
In past I use dynamic sql and datatable to get data from database. Such
My code works. After I copy about 10 tables I get an error. Dynamic
I am trying to get knockout.js to update my view after an ajax call
We get a large amount of data from our clients in pdf files in

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.