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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:18:36+00:00 2026-05-16T21:18:36+00:00

I have some JavaScript that is sharing a request between two separate servers on

  • 0

I have some JavaScript that is sharing a request between two separate servers on the same domain.

Is .com a requirement for the domain in JavaScript?

In this case both the servers are on the .abc.tyy domain with the tyy being what would normally be .com

Wondering if I can only use .com for the domain? I am getting a permission denied error, but this code works fine on other separate servers on the same domain(.com).

Updated:
Here is exactly how I’m using this:

123.abc.tyy has a script that loads properties that I want to access.

The script on 123.abc.tyy at opening script tag, sets the document.domain to ‘abc.tyy’.

When I call the ‘getUser()’ function in 123.abc.tyy’s script FROM 234.abc.tyy I am getting a permission denied error.

The way I am calling ‘getUser()’ is:
I access http://123.abc.tyy in a browser, and the site allows me to specify a URL to load in one of it’s frames. I point that URL to http://234.abc.tyy/BeginLoadPatient.aspx” in that page I am doing the following:

window.location = ‘http://234.abc.tyy/LoadPatient.aspx?PatientId=‘ + getUser() ‘; with getUser being a function originating in 123.abc.tyy

If I add 234.abc.tyy and 123.abc.tyy to my trusted sites, everything works fine – is this skipping over the same origin policy?

  • 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-16T21:18:36+00:00Added an answer on May 16, 2026 at 9:18 pm

    No, the SOP doesn’t care what the domain is, only that it represents the same origin. (Could it be that you have the .com domain hard-coded somewhere?)

    Note that there’s more than the domain to consider. The Same Origin Policy looks at protocol, port, and host as well. So aaa.abc.tyy and bbb.abc.tyy are different origins.

    If you’re in control of the servers involved, you might look at Cross-Origin Resource Sharing, but unfortunately CORS is only implemented in modern browsers (and on those versions of IE where it’s supported, it’s only supported if you use it explicitly).

    Another option, of course, is JSON-P, which has the advantage of working cross-browser right now.

    Another thing to look at is document.domain, details here and here.


    Update after your edits:

    The script on 123.abc.tyy at opening script tag, sets the document.domain to ‘abc.tyy’.

    When I call the ‘getUser()’ function in 123.abc.tyy’s script FROM 234.abc.tyy I am getting a permission denied error.

    You’ll need to set document.domain to "abc.tyy" in BeginLoadPatient.aspx as well.

    If I add 234.abc.tyy and 123.abc.tyy to my trusted sites, everything works fine – is this skipping over the same origin policy?

    I wouldn’t be at all surprised (although to me it would be pretty dodgy), but have no first-hand knowledge of it. Would be easy to test.

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

Sidebar

Related Questions

Here is the situation. I have some javascript that looks like this: function onSubmit()
I have some Javascript code that will programmatically register an COM interop assembly by
I have some third-party Javascript that has statements like this: FOO = function() {
I have some javascript that looks like this: var sel = '<option value={value} {selected}>{name}</option>';
I have some javascript that ends up programatically clicking on a button: document.getElementById(myButton).click(); This
Let's say I have some JavaScript that looks like this: function A() { var
I have some javascript that is embedded in the html file like this <html>
The situation is this: I have some JavaScript that creates an interactive dialogue (and
I have some JavaScript that should be getting this image URL[1] from an XML
I have some javascript that I am using for some audio on my website:

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.