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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:01:50+00:00 2026-06-07T16:01:50+00:00

I have found many similar issues to my problem. Maybe it is me me,

  • 0

I have found many similar issues to my problem. Maybe it is me me, but I am having a hard time finding a real clear answer as to why I can’t do multiple json requests or why this wouldn’t work.

Here is my jQuery code:

$.getJSON('http://api.espn.com/v1/sports/basketball/nba/teams/16/news?apikey=0001234', function(data) {
    console.log(data.headlines);              
});

$.getJSON('http://api.espn.com/v1/sports/football/nfl/teams/16/news?apikey=0001234', function(data) {
    console.log(data.headlines);
});

And here is the error I receive in the console log.

XMLHttpRequest cannot load http://api.espn.com/v1/sports/football/nfl/teams/16/news?apikey=62t2h4tsdmhr2q7aynvjuv2s. Origin null is not allowed by Access-Control-Allow-Origin.

When I run one $.getJSON request by itself it works fine. So I am assuming it is because I am making multiple requests. I am just not sure how to write it in a way where they don’t conflict with each other.Any help is appreciated. Thanks

EDIT

So I guess the question then.. Is it possible to do multiple request this way. Is there an issue with my code? Or is it most likely an issue with ESPN’s API. I could try using yahoo api and see if I get the same result.

  • 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-07T16:01:52+00:00Added an answer on June 7, 2026 at 4:01 pm

    Can you fire two json requests one after the other?

    Yes. They will not interfere with one another.

    Will ESPN return data for both the requests?

    Presently No. Your second request will be returned a 403 response. They might change that sometime, who knows…

    Why am I getting the error Origin null is not allowed by Access-Control-Allow-Origin.?

    As you mentioned in the comments, your script was executing from a url that began with file://. As mentioned in this answer

    There are two ways for CORS headers to signal that a cross-domain XHR
    is OK. One is to send Access-Control-Allow-Origin: * (which, if you
    were reaching Flickr via $.get, they must have been doing) while the
    other was to echo back the contents of the Origin header. However,
    file:// URLs produce a null Origin which can’t be authorized via
    echo-back.

    Once you host the file on some server, even localhost, you shoudnt receive that error. As an alternative, you could try using a jsonp request, if ESPN supports it.

    Try this query,

    $.getJSON('http://api.espn.com/v1/sports/football/nfl/teams/16/news?apikey=0001234&callback=?',     
    function(data) {
        console.log(data.headlines);
    });
    

    Notice the &callback=? at the end of the url…

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

Sidebar

Related Questions

I have found many people with simliar issues but no soultions...basically I have two
I have a problem that I have found many similar problems related to multi
I have been googling, a lot, and found quiet many similar issues around the
Yes, I've tried to search answer for this problem and I found many similar
I've found many similar questions on here, but none of the answers have solved
I have found many similar posts and even tried to find out how to
I have refereed old questions and found that people face many issues after installing
I can't make it work. I found many similar question here, examples. But nothing
I have found several similar answers but I can't quite get why this is
Let me start by saying I have looked at many similar questions asked, but

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.