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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:25:41+00:00 2026-05-23T21:25:41+00:00

I thought that the origin domain for XMLHttpRequest was the domain that loaded the

  • 0

I thought that the origin domain for XMLHttpRequest was the domain that loaded the javascript that is using it.

For instance, It thought that if on a page http://mydomain1.com/ I have:

<script src="http://mydomain2.com/script.js" />

script.js can interact with mydomain2.com via XHR. This was, I thought, one of the nice things about jsonp.

I am seeing a bit of evidence in some testing that even though JS loads from mydomain2.com, XHR’s origin is still mydomain1.com. Have I just been way off base all this time?

  • 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-23T21:25:42+00:00Added an answer on May 23, 2026 at 9:25 pm

    It is the domain of the page (possibly in a frame) which executes the JavaScript.

    If it were from the domain with which the JavaScript was loaded, what would happen for all the people using jQuery.ajax after loading jQuery from a CDN (such as this)?

    JSONP doesn’t allow acting as another domain, but rather it allows injecting from another domain. The source URI of the script element is not restricted to the same domain origin restriction as XHR: in this manner JSONP can be used to freely send data (in the URI) and execute the returned JavaScript (not JSON) directly in the context of the current page.

    Including script tags from remote sites allows the remote sites to inject any content into a website. If the remote sites have vulnerabilities that allow JavaScript injection, the original site can also be affected.

    Happy coding.

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

Sidebar

Related Questions

I have difficulties in seeing the point of the Access-Control-Allow-Origin http header. I thought
I thought that a delegate instance was interchangeable with a function instance. Take the
I thought that calling BeginInvoke more than once on the same delegate instance would
I thought that this was easier… I have a asp:hyperlink control, with target=_blank ,
I have been working on a JQuery script that posts JSON to my asp.net
I have written a web application that posts a file via http to a
So I ran this command: git checkout -b --track origin/RB_1.4.5 I thought that it
I thought that there was some way in .net 3.0 to give an array
I thought that it would be fun to present some classic CS problems and
I thought that to clone a List you would just call: List<int> cloneList =

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.