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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:00:08+00:00 2026-05-29T12:00:08+00:00

I need to access some JSON with JQuery. For some reason, it’s not working

  • 0

I need to access some JSON with JQuery. For some reason, it’s not working and since the getJSON method fails silently, I can’t figure out what’s wrong. I have checked that the JSON Url is correct. Thanks!

HTML:

<html>
<head>
    <script src="//code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript">
        $(document).ready(function(){
        $.getJSON('../src/json/baseball.json', function(data) {
            $("#add").html(data.baseball[0].levels[0].games[0].versus);
        });
        });
    </script>   
</head>
<body>
    <p id= "add"></p>
</body>
</html>

JSON:

{"baseball":
[{
    "gender":"boys",
    "levels":[
    {
        "level": "varsity",
        "games":[
        {
            "versus":"Fullerton",
            "homeaway":"Home",
            "month":"February",
            "date":"27",
            "year":"2012",
            "troyscore":"32",
            "vsscore":"41",
        },
        {
            "versus":"Sunny Hills",
            "homeaway":"Away",
            "month":"March",
            "date":"28",
            "year":"2012",
            "troyscore":"20",
            "vsscore":"17",
        }]
    },
    {
        "level": "jv",
        "games":[
        {
            "versus":"Sonora",
            "homeaway":"Home",
            "month":"January",
            "date":"20",
            "year":"2012",
            "troyscore":"15",
            "vsscore":"21",
        },
        {
            "versus":"Valencia",
            "homeaway":"Away",
            "month":"April",
            "date":"30",
            "year":"2012",
            "troyscore":"40",
            "vsscore":"1",
        }]
    }]
},
{
    "gender":"girls",
    "levels":[
    {
        "level": "varsity",
        "games":[
        {
            "versus":"Acacia",
            "homeaway":"Home",
            "month":"February",
            "date":"27",
            "year":"2012",
            "troyscore":"32",
            "vsscore":"41",
        },
        {
            "versus":"LV",
            "homeaway":"Away",
            "month":"March",
            "date":"28",
            "year":"2012",
            "troyscore":"20",
            "vsscore":"17",
        }]
    },
    {
        "level": "jv",
        "games":[
        {
            "versus":"Commonwealth",
            "homeaway":"Home",
            "month":"January",
            "date":"20",
            "year":"2012",
            "troyscore":"15",
            "vsscore":"21",
        },
        {
            "versus":"Xishan",
            "homeaway":"Away",
            "month":"April",
            "date":"30",
            "year":"2012",
            "troyscore":"40",
            "vsscore":"1",
        }]
    }]
}]
}
  • 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-29T12:00:13+00:00Added an answer on May 29, 2026 at 12:00 pm

    Each of the final properties of your inner objects have trailing commas, which makes your JSON badly formed. Just try pasting it into jsonlint.com. It will wine at every object’s last property.

        {
            "versus":"Fullerton",
            "homeaway":"Home",
            "month":"February",
            "date":"27",
            "year":"2012",
            "troyscore":"32",
            "vsscore":"41", <-- borked JSON
        },
    

    Complaint:

    Parse error on line 67:
    ...                    },                 
    -----------------------^
    Expecting 'STRING'
    

    $.getJSON will fail silently if the returned JSON is not strictly well-formed. I want to provide a reference from the docs, but it appears that the jQuery site is down….bleh.

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

Sidebar

Related Questions

I'm writing an app and I need to access some json data in the
I need to access some members marked internal that are declared in a third
I need to access some files with fstream in my C++ app on Windows.
I need to access code in a native C++ DLL in some C# code
There are some text files(Records) which i need to access using C#.Net. But the
I have some (small amount) of data that I'll need quick access to on
I'm a 80% ruby on rails developer, but still need to do some Access
I need to store some simple properties in a file and access them from
To implement data access code in our application we need some framework to wrap
I can't create a NT account for everyone that need access to the reports.

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.