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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:16:48+00:00 2026-05-31T19:16:48+00:00

I have a $.getJSON call that’s too long to post here. It all works

  • 0

I have a $.getJSON call that’s too long to post here. It all works fine except when I try to hide a div. My data is coming back from the database in the callback as “data” and is processed in a “for” loop (with “i” as the increment) in the callback. All of my data displays elsewhere fine. But when I try to do this:

var div = '#row' + data[i].id;
$(div).hide();

it fails.

I can replace “data[i].id” with the row number from the database and the div is hidden. If I alert div, I get “#row664” or whatever. Something about the combination of “#row” and the dynamically generated ID is causing the hide to fail.

The HTML in the same callback is:

   html = '<div id="row' + data[i].id + '">';

The HTML is appended to a div at the end of the callback. Everything else works, like I said. So it seems like this should work. What am I doing wrong?

  • 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-31T19:16:49+00:00Added an answer on May 31, 2026 at 7:16 pm

    make sure you append the div before you hide it.

    var div = '#row' + data[i].id;
    var html = '<div id="' +div+ '">';
    $('body').append(html);
    $(div).hide();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a call to a YouTube XML sheet that works perfectly fine. However,
I have the code below that shows a throbber and makes a getJSON call
I have a jquery that has first server function call using post and next
I have a very simple asp.net mvc3 app that uses jquery::getJSON to call into
Since updating to the latest JQuery I have noticed that all my getJson calls
Basically I have a getjson call to call for a bunch load of data.
Basically what I have here is a button that adds a new list item
I am retrieving JSON using jQuery's getJSON call. My problem is that some of
I have a very simple javascript class that does an ajax call to a
I have a JavaScript function that I use to call the Facebook API and

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.