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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:07:50+00:00 2026-06-18T15:07:50+00:00

Yes, I am new to jquery, and javascript. I have a page that has

  • 0

Yes, I am new to jquery, and javascript. I have a page that has both static html and python generated data that gets written to the page via ajax. I have a jquery slider that works just fine for the static html data that is already in the page, but will not work with the newly updated content. Ive tried placing the jquery slider code in the static html page as well as an external javascript source page. Neither works. Only when I place the jquery slider code in my python script which writes the new data to the page will it work, I really really don’t like what happens when the next set of dynamic data is imported. No clue what I’m doing wrong….

jquery code:

$(document).ready(function(){
  $(".noIbar").click(function(e){
    if (e.ctrlKey)
      {
        $(this).next(".panel").slideToggle("fast");
      }
  });
});

This is a screenshot of the working section of the code. When the user holds control key and clicks on the first (static html) line, it works, but the two second lines which are returned via python script are not working. I have a feeling this has to do with how the jquery is called.

Im calling the ajax script via onload in the body tag:

<body  onload="test();loadcontent();">

here is the ‘loadcontent()’ function:

function loadcontent()
{
$(document).ready(function(){    
$.get('cgi-bin/content.py', function(data) {
    $("#content").append(data);
});
});
}

This is the exact output from the python script:

<div class='noIbar' onclick="highlightLink(this);AddVar('1.2.840.113970.3.33.1.16671800.20120327.1134351')">
  <div class='data'>105630</div>
  <div class='data'>ISO_IR 100</div>
  <div class='data'>20120327</div>
  <div class='data'>135346.000</div>
  <div class='data'>00035MR120014044</div>
  <div class='endcap'>2681</div>
</div>
<div class='panel'>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.8.jpg"></div>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.9.jpg"></div>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.10.jpg"></div>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.11.jpg"></div>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.12.jpg"></div>
</div>

<div class='noIbar' onclick="highlightLink(this);AddVar('1.2.840.113970.3.33.1.14883629.20111109.1132327')">
  <div class='data'>121011</div>
  <div class='data'>ISO_IR 100</div>
  <div class='data'>20111109</div>
  <div class='data'>133143.000</div>
  <div class='data'>00035US110137393</div>
  <div class='endcap'>US OB</div>
</div>
<div class='panel'>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.8.jpg"></div>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.9.jpg"></div>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.10.jpg"></div>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.11.jpg"></div>
  <div class='img'><img src="icon/1.2.840.113619.2.5.2431209.13665.1332882288.12.jpg"></div>
  • 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-18T15:07:52+00:00Added an answer on June 18, 2026 at 3:07 pm

    Here is the fix for your problem :

    $(document).ready(function(){    
        $.get('cgi-bin/content.py', function(data) {
            $("#content").append(data);
            $(".noIbar").click(function(e){
                if (e.ctrlKey)
                {
                    $(this).next(".panel").slideToggle("fast");
                }
            });
        });
    });
    

    You had added call back function before the ajax call. After getting response from your python script you are adding content to DOM, new content added will not respond to call back events until and unless you define them again for new elements.

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

Sidebar

Related Questions

I have a form on a page that adds new data to a database
I'm pretty new to javascript and jquery, and have run into a problem that
I am very new to jQuery and javascript programming. I have a program below
Yes, I understand that JavaScript doesn't have classes per se, so I'll just throw
I'm new to stackoverflow and HTML/CSS/Javascript. I have four tabs and I want them
I have multiple html documents that share one css stylesheet (not multiple page div
Yes I have a project that I'm working on in NetBeans 7.1 and I
Visual Studio 2010 has a new feature that is just way cool. You can
my code: <html> <head> <script type=text/JavaScript src=jquery-1.3.2.min.js></script> <script type=text/JavaScript src=jquery.center.js></script> <script type=text/JavaScript> $(document).ready(function(){ $('a').click(function(){
Based from this link: How to build a jQuery dialog for confirmation (yes/no) that

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.