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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:19:36+00:00 2026-06-02T18:19:36+00:00

I have the following situation. From an application located in https://subdomain.mydomain.com I am trying

  • 0

I have the following situation.

From an application located in https://subdomain.mydomain.com I am trying to get the html of a page located in https://mydomain.com/page.aspx

I’m doing this with the jquery $.ajax method.

    $.ajax({
        url: url,
        type: 'GET',
        contentType: 'application/x-www-form-urlencoded',
        success: function (data, status, xhr) {
            console.info("success");
        },
        error: function (xhr, status, error) {
            console.error(error);
        }
    });

The aspx page is actually called and executed.

IE (through XDomainRequest) and Firefox have the same behavior: from the inspectors (IE dev tools and Firebug) I see that the response status is 200 OK and it has the expected size (80KB) but the response content is empty.
The jQuery error is not so useful:

    readyState: 0,  
    responseText: ""
    status: 0,
    statusText: "error"

I guess it’s something involving the Same Origin Policy. I see people solving this kind of issues with YQL (but i don’t want to use additional libraries) and JSONP (but I’m working with plain HTML).

In a moment of desperation I have tried also tricks like

    document.domain = 'mydomain.com';
    jQuery.support.cors = true;

No success. Any tip?


The problem was due to the Access-Control-Allow-Origin that must be enabled on the called application. In my case, it was an asp.net application in IIS7 hosting. I had to add these lines in the web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <system.webServer>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
 </system.webServer>
</configuration>

The following website reports many configuration to enable CORS on many server types

  • 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-02T18:19:38+00:00Added an answer on June 2, 2026 at 6:19 pm

    In order to use IE’s or FF’s cross-origin requests you need to tune up your server side to send Access-Control-Allow-Origin header with the response. And if you want to use document.domain it must be set not only at the requesting side, but in the response too. So you can use iframe to send such a request or use SCRIPT or JSONP since they have no cross-origin limitations.

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

Sidebar

Related Questions

I have the following situation: I have an application that collects some data from
I have the following situation: excel-like application, that is accessible from internet. 2 users
I have the following situation. Im getting data from an external system in the
I have following situation (simplified, of course): MyDomain.groovy: class MyDomain { MyAnotherDomain anotherDomain //
I have following Situation, Server A sends some data (HTML form) to server B,
i have the following situation, i have a Reporting layer(stand alone) in asp.net application(NOT
I have a problem on the following situation: In my Spring, Hibernate application I
Consider the following common situation: You have some MainView in your Cocoa application, loaded
I have the following situation: my application's authorization mechanism is implemented using Spring security.
I have the following situation and I'm expecting some expert advise from SO folks.

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.