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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:19:59+00:00 2026-05-13T10:19:59+00:00

Question: I’m trying to use JSON accross domains, but all i find is JSON

  • 0

Question:

I’m trying to use JSON accross domains, but all i find is JSON parsers, which I don’t need…

I’ve read that it’s possible to do cross-domain requests with JSON,
but so far, all I see is implementations that use XMLHttpRequest…
– which means you can’t use cross-domain requests, at least not outside IE 8…

I’ve been on http://www.json.org/, but all I find is either parsers or useless.

The best I’ve found with google so far is
http://devpro.it/JSON/files/JSONRequest-js.html


but this is rather a mess, doesn’t work cross domain, and intra-domain neither – or rather not at all…

var the_object = {}; 
var http_request = new XMLHttpRequest();
http_request.open( "GET", url, true );
http_request.onreadystatechange = function () {
    if ( http_request.readyState == 4 && http_request.status == 200 ) {
            the_object = JSON.parse( http_request.responseText );
        }
};
http_request.send(null);
  • 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-13T10:20:00+00:00Added an answer on May 13, 2026 at 10:20 am

    What you can do cross-domain is inject a script include:

    var s = document.createElement('script');
    s.src = 'http://someotherdomain/getMeMyJs.aspx?parameter=value';
    s.onload = someOptionalCallback;
    s.type = 'text/javascript';
    
    if(document.getElementsByTagName('head').length > 0)
        document.getElementsByTagName('head')[0].appendChild(s);
    

    Now, the code returned by that request will be executed immediately. If you want for that to interact with your code, you can make sure that it’s being returned with all data wrapped in a function call:

    jsonCallback({ object: json, whatever: value });
    

    You can use that to build APIs, where you pass the name of a callback function as a request querystring parameter. Here’s an example of such an API

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

Sidebar

Related Questions

Question explains it all really, I need to add some text to a PDF
Question is probably pretty basic, but can't find out what's wrong (and it leads
Question: How can I give a new user almost all privileges, but still keep
QUESTION: What am I missing or doing wrong? I'm trying to migrate fully functional
Question should be self explanatory. I have a datagridview which has a column whose
Question says it all ... is there a way to generate more than 50
Question says it all...
Question ago ( Reseting generator object in Python ) I was recommended to use
This could be a duplicate question, but I have no idea what search terms
Question I am running a bit of an experiment and could use some help.

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.