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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:19:42+00:00 2026-05-27T20:19:42+00:00

When finished parsing the json into the specified span tags I wanted to automatically

  • 0

When finished parsing the json into the specified span tags I wanted to automatically hide the imperial tags currentimperial and forecastimperial but when I try to do this use

$('#currentimperial').hide();

$('#forecastimperial').hide();

and view the result in chrome and look in the console I see that instead of

style="display: none; "

they actually have

style="display: inline; "

Here is my whole javascript and html on jsBin http://jsbin.com/efaguv/edit#javascript,html

Thanks for any help I recieve.

  • 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-27T20:19:42+00:00Added an answer on May 27, 2026 at 8:19 pm

    I think the problem is that you haven’t allowed for the fact that your ajax call is asynchronous.

    A much simplified example of what’s happening:

    1 jQuery(document).ready(function($) {
    2   $('#warning').remove('#warning');   
    3   $.ajax({
    4        url: 'http://api.wunderground.com/api/APIKEYREMOVED/geolookup/conditions/forecast/q/51.773079,-1.591353.json',
    5        dataType: "jsonp",
    6        success: function(parsed_json) {
    7           $('#currentimperial').fadeIn(1000).append(+temp_f+ '℉ ');
    8        }
    9    });
    10 
    11   $('#celcius').hide();
    12   $('#currentimperial').hide();
    13   $('#forecastimperial').hide();
    14 });
    
    • line 2 executes
    • line 3 executes to make the ajax request (response will be received at some point in the future)
    • lines 11-13 execute to hide the items
    • line 14: your document ready function completes
    • (eventually) ajax response is received and success handler is called so line 7 executes.

    Because (in your full code) the ajax success callback makes the elements visible (using .fadeIn()) the end result is that they are visible.

    Can you instead hide the elements within that ajax success callback?

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

Sidebar

Related Questions

I finished my website and uploaded it to my webhost, but i get this
Already finished implementing the player. I want to implement the progress bar. But I
I just finished a small project where changes were required to a pre-compiled, but
I need to parse some XML that triggers an NSURLConnection. After the parsing finished,
I have the following code that decodes a JSON string into an array of
I finally finished my XML parsing code, and now looking at it, it scares
I am using the QJson for parsing. But I am stuck up with some
Just finished read this post by Greg Young, where he is talking about Microsoft
Just finished reading Crockford's JavaScript: The Good Parts and I have a question concerning
I finished building an app that allows beaming of photos, contacts and text clips

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.