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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:26:20+00:00 2026-05-28T01:26:20+00:00

I am trying to debug a problem and I seemed to have tracked it

  • 0

I am trying to debug a problem and I seemed to have tracked it down but I do not have the technical explanation for why it is happening.

I have a piece of query code that monitors the onclick event on a radio button, and causes a text input(s) to fadein/fadeout according to certain clicks.

What I noticed is even thought his code wasnt changing, I was having to clear my cache to get the code to work properly a lot. I have no clue why but I looked at the code (not written by me):

$(function(){     
  $('.radioSelect_2').click(function(){
    if ($(this).attr("id") == "sub_option_1")
    {
      $('#secondary_sub_1').fadeIn("fast");
      $('#secondary_sub_2').fadeOut("fast");
      $('#secondary_sub_3').fadeOut("fast");
      $('#secondary_sub_4').fadeOut("fast");
      $('#secondary_sub_5').fadeOut("fast");
      $('#secondary_sub_6').fadeOut("fast");
      $('#secondary_sub_7').fadeOut("fast");    
    } 
    else
    {
      $('#secondary_sub_1').fadeOut("fast");
      $('#secondary_sub_2').fadeIn("fast");
      $('#secondary_sub_3').fadeOut("fast");
      $('#secondary_sub_4').fadeOut("fast");
      $('#secondary_sub_5').fadeOut("fast");
      $('#secondary_sub_6').fadeOut("fast");     
      $('#secondary_sub_7').fadeOut("fast");      
    }   
})

And it looks like it is being set up to extend jQuery, so I changed it to

$(document).ready(function() {
  $('.radioSelect_1').click(function(){
    if ($(this).attr("id") == "option_1")
    {
        $('#sub_1').fadeIn("fast");
        $('#sub_2').fadeOut("fast");
        $('#sub_3').fadeOut("fast");
        $('#sub_4').fadeOut("fast");
        $('#sub_5').fadeOut("fast");
        $('#sub_6').fadeOut("fast");
    } 
   else if ($(this).attr("id") == "option_2")
    {
      $('#sub_1').fadeOut("fast");
      $('#sub_2').fadeIn("fast");
      $('#sub_3').fadeOut("fast");
      $('#sub_4').fadeOut("fast");
      $('#sub_5').fadeOut("fast");
      $('#sub_6').fadeOut("fast");    
    }   
});

And it fixes my problem. No more clear cache.etc.
I cannot figure out why, I am hoping guys can.

  • 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-28T01:26:20+00:00Added an answer on May 28, 2026 at 1:26 am

    From jQuery’s docs:

    All three of the following syntaxes are equivalent:

    • $(document).ready(handler)
    • $().ready(handler) (this is not recommended)
    • $(handler)

    The only thing I can see is that you’re missing a semi-colon in the first code block, but that is most likely a copypasta error…

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

Sidebar

Related Questions

I just spent hours trying to debug my code. The whole problem boiled down
I'm trying to debug a problem that happens on Safari 3.1 (but not in
I've been trying to debug this problem for many hours, but to no avail.
I'm trying to debug a problem with a create statement I have however the
I have a very persistent problem, im trying to debug the program through the
I am trying to debug a problem where users occasionally have locked files which
I'm trying to debug a little problem I have with a web service. I
I'm trying to debug a problem with some legacy code. While trying to understand
I'm trying to debug a problem in prod from a reported stack trace, but
Ok, trying to debug another problem I have, I decided to make sure my

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.