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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:40:57+00:00 2026-06-04T11:40:57+00:00

I am brand new to actually using an API, getting the JSON data and

  • 0

I am brand new to actually using an API, getting the JSON data and throwing it in to an actually HTML file and making the results look pretty.

I am good with HTML/CSS/jQuery. But not this in depth with jQuery it seems (I can do the basics)

This is an example of the JSON data I am getting back from Weather Underground’s API

    "current_observation": {
    "image": {
    "url":"http://icons-ak.wxug.com/graphics/wu2/logo_130x80.png",
    "title":"Weather Underground",
    "link":"http://www.wunderground.com"
    },
    "display_location": {
    "full":"Bowling Green, KY",
    "city":"Bowling Green",
    "state":"KY",
    "state_name":"Kentucky",
    "country":"US",
    "country_iso3166":"US",
    "zip":"42101",
    "latitude":"37.02899933",
    "longitude":"-86.46366119",
    "elevation":"154.00000000"
    }

I can see from this that display_location is inside of current_observation.

I want to pull out and display full as an h1 on my website (I actually want to do more info, but I feel like after I get this down I can handle the rest.)

So here is what I have currently:

<!DOCTYPE HTML>
<html>
    <head>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    </head>
    <body>
        <section id="area"></section>
    </body>
    <script type="text/javascript">
        $().ready(function(){ 
            $.getJSON("http://api.wunderground.com/api/[MY API KEY]/conditions/q/autoip.json",
            function(data){
                $.each(data){
                    content = '<h1>' + json.current_observation.display_location.full + '</h1>';
                    $(content).appendTo("#area");
                 });
              });
           });
    </script>
</html>

It does not work :-/

Any help is great.

  • 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-04T11:40:58+00:00Added an answer on June 4, 2026 at 11:40 am

    Look at this:

    content = '<h1>' + json.current_observation.display_location.full + '</h1>';
    

    What does json refer to ?? Also $.each(data){ is invalid syntax. See docs. Your each loop should probably look like

    $.each(data, function(i, json) {
        content = '<h1>' + json.current_observation.display_location.full + '</h1>';
        $(content).appendTo("#area");
    });
    

    which will work if the data returned is an array of objects like that which is included in the question. You should console.log(data) to see its form.. you may be able to eliminate the each loop and just use

    content = '<h1>' + data.current_observation.display_location.full + '</h1>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm brand new to Moq (using v 4) and am struggling a little with
brand new to MongoDB / mongoid and still pretty green on ruby / rails
Brand new to django. We have a legacy django project using django 0.96x that
Using Xcode 4.3.2, starting a brand new Single View App, in ViewController's - (void)viewDidLoad
Brand new to Cocoa and I'm trying to figure out how to copy an
Brand new poster here on StackOverflow. I've been reading and learning here for some
I'm basically brand new to LINQ. I've looked around a lot on here and
I'm brand new at Python and I'm trying to write an extension to an
I'm brand new to SQL Server 2008, and have some newbie questions about the
I'm brand new to java, coming from a ruby world. One thing I love

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.