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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:47:50+00:00 2026-05-23T07:47:50+00:00

I have a page http://www.a.com/hello which will return a JSON, now I want to

  • 0

I have a page http://www.a.com/hello which will return a JSON, now I want to get it in http://www.b.com I tried several cross-domain-ajax method, but none of them worked:
1. I have no control over a.com(though I trust it, so don’t worry about XSS)
2. to access a.com/hello, cookie/session are needed, so I can’t use a proxy on b.com.
Then I turn my eyes to other method, I notice that img, script, iframe can get contents cross domain, so I try to use them to load the content:
1. iframe: I can see the content in iframe, but I can’t get it from js due to same-origin-policy.
2. img: Can’t see the content.
3. script: I can see that content is loaded and evaluated, but when I try to get the contents between the <script> using innerHTML, I got nothing.

My question is, how to do the 3rd method above? or is there other ways that could solve my problem?
The content of what http://www.a.com/hello is like:

 {"candidate":[{"id":251574647,"name":"\u5f20\u6f47"}]} 
  • 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-23T07:47:50+00:00Added an answer on May 23, 2026 at 7:47 am

    No, you can not directly the access the contents of a script element in the page. To be able to do what you want you will have to use JSONP or have the output of your script set/update a specific variable.

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

Sidebar

Related Questions

I have the following page (deadlink: http://www.workingstorage.com/Sample.htm ) that has a footer which I
So I have this page here: http://www.eminentmedia.com/development/powercity/ As you can see when you mouse
Note: I'm using Google Chrome Currently I have this test page http://www.evecakes.com/doodles/canvas_size_issue.htm It should
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
My goal is to have the url routing as following: http://www.abc.com/this-is-peter-page http://www.abc.com/this-is-john-page What is
I have page, i can contact directly without any problems. http://www.mysite.com/app_dev.php/comments/22 the page shows
I have been working on a dynamic page http://www.euroworker.no/order and I want my lovely
I have this page: http://www.comehike.com/hiking.php <div style=align:center> <div id=fb-root></div> <script src=http://connect.facebook.net/en_US/all.js#appId=217585988283772&amp;xfbml=1></script> <fb:like href= send=true
I have a web page http://www.maryveale.com/sculpture/index.html that loads a js at /media/js/bill-studio.js that causes
I have a page at http://www.problemio.com/problems/problem.php , and you see on the bottom-right I

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.