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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:35:23+00:00 2026-05-20T06:35:23+00:00

I have a large AJAX response which inserts a good amount of HTML. After

  • 0

I have a large AJAX response which inserts a good amount of HTML. After this I can’t work with any of the newly created IDs or Classes as if they were present when the form was loaded.

I have looked into .live() which solves one of my problems but not the other.

I basically want to show a DIV either by ID or class that was inserted via AJAX .html() when a link is clicked.

Example:

CODE:

html_out = "<div class='span-1'><a href='#' onClick='show_sub_row(\"#sub_row" + id + "\"); return false;'>[ + ]</a></div>";
html_out += '<div class="hidden_sub_row prepend-2" style="display: none;" id="#sub_row' + id + '">';
html_out += 'Content';
html_out += '</div>';
$('#search_results').html(html_out);

Then after the HTML is created I try:

function show_sub_row(sub_row) { 
$(sub_row).show('fast');
}

I know it is referencing the correct ID since I can do a alert(sub_row) and it shows the correct ID that matches the ID shown using FireBug to inspect the hidden 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-05-20T06:35:24+00:00Added an answer on May 20, 2026 at 6:35 am

    Unless sub_row is an initialized var somewhere outside of the code you have represented here, the block should be:

    function show_sub_row(sub_row) { 
    $('#sub_row').show('fast');
    }
    

    Also, your actual HTML ID for sub_row contains a # character which may make this even more difficult to pinpoint the real issue. I would modify it to:

    html_out += '<div class="hidden_sub_row prepend-2" style="display: none;" id="sub_row' + id + '">';

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

Sidebar

Related Questions

I have a Webforms, AJAX-enabled web page which, when rendering large amounts of data,
I have to handle large amount of data retrieved from server using ajax and
I'm preparing project for web application with large AJAX usage, which should work on
I have fairly large set of data returned via AJAX from a page. This
I have a large block of HTML that needs to be replaced, which includes
I have a search that returns JSON, which I then transform into a HTML
i have a page where i pull some html from an ajax request and
I have a fairly large map consisting of Raphael paths which im trying to
I work at a company with a large SAP investment, and we also have
I have a large 1 page ASP.Net application. Much of this application has been

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.