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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:09:43+00:00 2026-06-10T01:09:43+00:00

I have the following json data: var JSONObject2= { weather: { curren_weather: [ {

  • 0

I have the following json data:

var JSONObject2= {
    "weather": {
        "curren_weather": [
            {
                "humidity": "69",
                "pressure": "1012",
                "temp": "70",
                "temp_unit": "f",
                "weather_code": "1",
                "weather_text": "Mostly cloudy",
                "wind": [
                    {
                        "dir": "Not Available",
                        "speed": "0",
                        "wind_unit": "mph"
                    }
                ]
            }
        ],
        "forecast": [
            {
                "date": "2012-08-21",
                "day": [
                    {
                        "weather_code": "0",
                        "weather_text": "Sunny skies",
                        "wind": [
                            {
                                "dir": "NW",
                                "dir_degree": "311",
                                "speed": "7",
                                "wind_unit": "mph"
                            }
                        ]
                    }
                ],
                "day_max_temp": "83",
                "night": [
                    {
                        "weather_code": "0",
                        "weather_text": "Clear skies",
                        "wind": [
                            {
                                "dir": "WNW",
                                "dir_degree": "289",
                                "speed": "7",
                                "wind_unit": "mph"
                            }
                        ]
                    }
                ],
                "night_min_temp": "57",
                "temp_unit": "f"
            },
            {
                "date": "2012-08-22",
                "day": [
                    {
                        "weather_code": "0",
                        "weather_text": "Sunny skies",
                        "wind": [
                            {
                                "dir": "N",
                                "dir_degree": "7",
                                "speed": "4",
                                "wind_unit": "mph"
                            }
                        ]
                    }
                ],
                "day_max_temp": "85",
                "night": [
                    {
                        "weather_code": "0",
                        "weather_text": "Clear skies",
                        "wind": [
                            {
                                "dir": "S",
                                "dir_degree": "176",
                                "speed": "7",
                                "wind_unit": "mph"
                            }
                        ]
                    }
                ],
                "night_min_temp": "63",
                "temp_unit": "f"
            }
        ]
    }
};

On very simple json data, I can figure out how to get at the variables. On something like the above, it is difficult for me.

So to access say where the temp is 70, I would code:
var my_temp= weather.curren_weather.temp // This does not work

So just as 2 examples how would I get at the temp(70) and say where the wind_degree is 311?

Also is there a program where you can paste in the json object like the above and it will output the correct code needed to access any variable?

Thanks,
Jim

  • 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-10T01:09:45+00:00Added an answer on June 10, 2026 at 1:09 am

    Your object is complicated by the nested arrays, and it’s unclear why current weather requires a nested array.

    To get at the temp of 70 given this structure, you’ll need:

    var temp = JSONObject2.weather.curren_weather[0].temp;
    

    And for that particular wind reading:

    var wind = JSONObject2.weather.forecast[0].day[0].wind[0].dir_degree;
    

    For the forecast field, the nested array is reasonable, since you’re given a list of forecasts for different datesm and so the daytime wind reading for the second date represented in your data can be extracted using:

    var wind = JSONObject2.weather.forecast[1].day[0].wind[0].dir_degree;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: $.getJSON('data.json', function(data) { var items = []; $.each(data, function(key,
I have following problem DATA: var json = {'data': [{'id': '1', 'members': [{'name':'First member',
I have the following JSON data being returned, but for some reason, Javascript or
I have a JSON that contains the following: {p1:{debris:{titanium:0,silicum:0}},p2:{debris:{titanium:0,silicum:0}}... I declare the data using
I have the following json object. var json1 = {00 : 00, 15 :
I have the following code; $.ajax({ url: /Home/jQueryAddComment, type: POST, dataType: json, data: json,
I have following kind of index while accessing json data using jquery data.rows[0].student_1 data.rows[0].student_2
In the past I have used the following method to parse the json data
I have following json data which I want to pass it to server using
I have a controller that generates the following json data: [ { title: Option

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.